Hello friends I tried to construct file object specifying path for a file on the local disk as well as using a file on the floppy drive as follows. It gives problem when I construct new File with path of the file on floppy disk. File f1 = new File( " c:\\jdk1.3\\bin\\test); it compiles & gives result for all File class methods like exists(), canWrite(), canRead() etc. but when i do File f2 = new File ( " A:\\javaranchquestion "); // this file is there on my floppy drive. it compiles but returns false for exists(), canRead(), canWrite() methods My question is Is it that the File object will be created only with "path" pointing to the existing file on the local drive?
Try using a smaller file like a:\\test and post your experience. I am sure drive does not matter. You can read and write to any file to which you have access. I am guessing that there may be some issue with the handling of long file names for floppy disk. Keep us posted -- Hari Gangadharan
<B>Hari Gangadharan</B><BR>Unix is user friendly..<BR>but it chooses to whom it is friendly with!
Hi, i tried File f2 = new File ( " A:\\javaranchquestion.txt"); // this file is there on my floppy drive. it compiles and returns true for exists(), canRead(), canWrite() methods I think it doesn't matter whether file/dir is in hard drive or floppy drive. Avi