T
Tom
I try this code:
File file = new File(args[0]);
String filename = file.getName();
System.out.println("file name : " + filename);
I run it on windows with these arguments:
/opt/test/test1.txt
c:\windows\test2.txt
I got this:
file name : test1.txt
file name : test2.txt
If I run it on Linux I get this:
file name : test1.txt
file name : c:\windows\test2.txt
Why I don't get the same thing? I know it does not make sense to write
down a path that isn't in the system format. I will use an URL format
to get the real name…
Tom
File file = new File(args[0]);
String filename = file.getName();
System.out.println("file name : " + filename);
I run it on windows with these arguments:
/opt/test/test1.txt
c:\windows\test2.txt
I got this:
file name : test1.txt
file name : test2.txt
If I run it on Linux I get this:
file name : test1.txt
file name : c:\windows\test2.txt
Why I don't get the same thing? I know it does not make sense to write
down a path that isn't in the system format. I will use an URL format
to get the real name…
Tom