Constructing a Filename Path

A File object is used to represent a filename. Creating the File object has no effect on the file system; the filename need not exist nor is it created.

On Windows, this example creates the path \a\b. On Unix, the path would be /a/b.

String path = File.separator + "a" + File.separator + "b";

Comments

8 Jan 2010 - 3:56pm by smallfoottwo (not verified)

I like this site logo, it's very cute. more

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.