🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2050

Re: the "/" character in File path

#2050
From: Joi Ellis [TeamB]
Date: Mon, 09 Jul 2001 12:24
33 lines
2245 bytes
Yonatan Taub <yonatanta@bashan.co.il> wrote:
> I'm using a Windows 98 OS.
> When I create a File instance, I can specify the file it represents by a
> string such as "c:/folder1/myfile.txt".
> This will work fine although the actual file separator in the Windows
> platform is "\".

> Just wanted to know if such a thing might matter and if anyone encountered
> problems with that.
> The other option which requires a bit more typing is concatenating the path
> with File.separator.
> This would also be platform independent.

> Would like to hear your thoughts.

The concept of a drive letter is also foreign on *nix and, I believe, on
Macs.  I have a number of "C:\JBuilder\blah" files in my home directory
on my linux workstations coming from various opentools which were 
developed on Windows.

If you use USER.HOME as the starting point for locating files, you don't
have to worry about drive letters.  The same is true if you let
the user select the file location with a JFileChooser,

On a *nix machine a user doesn't generally have write permissions on the
root partition, anyway, so putting stuff under USER.HOME is the preferred
location.

-- 
Joi Ellis (TeamB)               http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <3b49a298_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-peer-west.sprintlink.net!news.sprintlink.net!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail
References: <3b49737f$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,28072edcddf949c3
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-07-09 05:27:03 PST
Message-ID: <3b49a298_1@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Supersedes: <3b499f4f_1@dnews>
Subject: Re: the "/" character in File path
Newsgroups: borland.public.jbuilder.java.api
References: <3b49737f$1_1@dnews> 
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3 (i686))
NNTP-Posting-Host: 209.46.41.66
Date: 9 Jul 2001 05:24:57 -0700
X-Trace: dnews 994681497 209.46.41.66 (9 Jul 2001 05:24:57 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-peer-west.sprintlink.net!news.sprintlink.net!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail