-
problem of FILE
hi all,
i want to know if a file exists, here is my code :
------------------------
File dd = new File("G:/SQL.LOG");
boolean f = dd.isFile();
out.println("dan = " + f);
------------------------------
(the file sql.log exists)
i can see :" dan = true"
that's logic
but when i change the code:
------------------------------
File dd = new File("G:/act_tma/test.log");
out.println(rep_tableau + nom_tableau);
boolean f = dd.isFile();
out.println("dan = " + f);
-----------------------------
(the file test.log exists)
i can see: "dan = false"
what is not logic...
have you an idea???
PS : G:/ is connected to a network
-
it's the same thing if i put the method exists() instead of isFile()
why???
-
f.exists() verify if the file indicated by this path exists and
f.isFile() verify if the file exists and is a norma file (is not a directory and satisfy other conditions which dependts of your system)
See Java API documentation
-
the path exists but when i use the method exists(), it returns always false...
-
normal I mean (I ate an "l")
I don't really know what exactly means "normal file" but I think that a "system file" is not a regular file for example. I hope I don't mistake !
Cristian
-
I think beacause this file with ".log" extension isn't a regular file ...
-
when i use a .xls, it's the same thing... :(
-
Sorry I was wrong, but I think this is a network problem ...
-
try for the same files but local, on your machine
-
it works on local
but it works also on the root of G: which is on the network...
-
Maybe you don't have sufficient rights to those files on the network
-
but i can open those files "manually"
-
Yes, but in order to access them from an Java programme I think you should have full acces to the path where "they" are.
-
do you know a method to copy it on the local machine?
perhaps with 'cp' of MSDOS console?
-
copy source destination (for MS-DOS)
Ctrl+C and Ctrl+V in your destination path .... (other OS)