Article View: borland.public.jbuilder.java.api
Article #2048Re: the "/" character in File path
From: Joi Ellis [TeamB]
Date: Mon, 09 Jul 2001 12:10
Date: Mon, 09 Jul 2001 12:10
33 lines
2195 bytes
2195 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 what driver letter. 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:
<3b499f4f_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!gatel-ffm!news-fra1.dfn.de!news-lei1.dfn.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mailReferences:
<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:12:59 PST
Message-ID: <3b499f4f_1@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
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:10:55 -0700
X-Trace: dnews 994680655 209.46.41.66 (9 Jul 2001 05:10:55 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!gatel-ffm!news-fra1.dfn.de!news-lei1.dfn.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail