File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
java program for linux
Joined: Jun 16, 2004
Jul 25, 2006 08:44:00
Can someone please tell me how to write a file's path for linux in
. We write for windows as
File file = new File("D:\\testdir\\testfile.txt");
How can we write this path if we are on linux.
Joined: Feb 15, 2005
Jul 25, 2006 09:19:00
In UNIX there is no drive letter as there is in DOS. There is only "root", which is the lowest level of the file structure. Also, in UNIX, the path separator is a forward slash instead of a backslash. Your path, then, would look like this:
I agree. Here's the link:
subject: java program for linux
write a file from liux to windows
Setting path in linux
Need a little bit of help
run a batch file (.bat) from java programm (.java)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014