Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Create a FilePath which is absolute?

Moderators: larsivi kris

Posted: 03/05/07 07:45:47

When in the directory "C:\programming", the following program prints:

C:\programmingtest
C:\programming.\tete

Is this right?

Thanks,

Bradley

import tango.io.FilePath;
import tango.io.FileSystem;
import tango.io.Stdout;

void main() {
  FilePath dir = FileSystem.toAbsolute(new FilePath("test"));
  Stdout(dir).newline;
  dir = FileSystem.toAbsolute(new FilePath(".\\test"));
  Stdout(dir).newline;
}

Author Message

Posted: 03/05/07 17:47:31

nope ... yuck

Posted: 03/05/07 20:06:37

Fixed. Thank you

Posted: 03/06/07 05:47:26

What about this?

import tango.io.FilePath;
import tango.io.FileSystem;
import tango.io.Stdout;

void main() {
  FilePath dir = FileSystem.toAbsolute(new FilePath("."));
  Stdout(dir).newline;
}

Output:

C:\\..