In Java how to read a file from network directory (windows mount directory)
in my windows pc, I have a mounted network 开发者_Go百科directory called p:/projects/file.txt
I got a file not found exception when I did this "File f = new File(p:/projects/file.txt)"
I thought the Java I/O 's native implementation has a hook with windows.
but apparently its not, is there anyway doing it?
the real code I used is "File f = new File(C:\files\test.txt)" and the network mounted drive is in "P:/projects/file.txt", the code works with local drive, not with the P drive
I know this is old, but you realize you've got forward slashes for your P: Drive and back slashes for your C: Drive. Forward slashes don't work on Windows. They do on a linux or Unix system.
精彩评论