Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Hey, I have a question on opening, and writing to and reading from files. Whenever I try to open a file using the File class, it doesn't work. I use the constructor File(String name), where name is a pathname. But I keep getting a compiler error if I use a pathname that extends beyond the c drive. (Ex. "c:\test.txt" will work, but "c:\windows\test.txt" gives me an error). Secondly, even if I use the pathname "c:\test.txt", and place the text file under the root directory ("c:\"), I get the output that the File Is Not Found. Does anyone know what am I doing wrong. Also, how do you determine the length of a file. I need this to be able to deal with files in binary mode. If you want I can email you my code, and you can check to see what is going wrong, just give me a shout on my address. Thanx for the help! Replies:
|
Sponsored Links
|