-
May 2nd, 2003, 05:56 AM
#1
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
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:04 AM
#2
it's the same thing if i put the method exists() instead of isFile()
why???
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:16 AM
#3
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
-
May 2nd, 2003, 06:21 AM
#4
the path exists but when i use the method exists(), it returns always false...
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:22 AM
#5
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
-
May 2nd, 2003, 06:23 AM
#6
I think beacause this file with ".log" extension isn't a regular file ...
-
May 2nd, 2003, 06:26 AM
#7
when i use a .xls, it's the same thing...
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:27 AM
#8
Sorry I was wrong, but I think this is a network problem ...
-
May 2nd, 2003, 06:28 AM
#9
try for the same files but local, on your machine
-
May 2nd, 2003, 06:31 AM
#10
it works on local
but it works also on the root of G: which is on the network...
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:34 AM
#11
Maybe you don't have sufficient rights to those files on the network
-
May 2nd, 2003, 06:36 AM
#12
but i can open those files "manually"
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:40 AM
#13
Yes, but in order to access them from an Java programme I think you should have full acces to the path where "they" are.
-
May 2nd, 2003, 06:43 AM
#14
do you know a method to copy it on the local machine?
perhaps with 'cp' of MSDOS console?
L'alcool tue lentement. On s'en fout. On n'est pas pressés.
-
May 2nd, 2003, 06:48 AM
#15
copy source destination (for MS-DOS)
Ctrl+C and Ctrl+V in your destination path .... (other OS)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|