File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes pathname Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "pathname" Watch "pathname" New topic


Ranch Hand

Joined: Aug 03, 2000
Posts: 169
Are pathname, fliename platform independent?
- Thanks.
Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
I believe that pathname / filename are platform DEPENDENT.
RHE gives the following example on page 378:
on a Unix machine:
File f = new File("/tmp", "xyz"); // assume /tmp is a directory
on a Windows machine:
File f1 = new File("C:\\a"); // assume C:\\a is a directory
File f2 = new File(f1, "");
I agree. Here's the link:
subject: pathname
It's not a secret anymore!