Originally posted by Martin Lira:
This is what i use for the move,
One problem here, if the source file is very large and still downloading while the moveFile is executed, it returns a false.
on which operating system?
different OS's have different file system semantics; on some, you should be able to move a file that's still being appended to, on others you might not. it might even depend on whatever is doing the downloading and is adding more data to the file; some programs might get really confused if you move their target file from underneath them even if the operating system itself would normally let you, other programs might take it in stride.
Is there any method in the File that will specify the file is still not there completely and wont call the moveFile.
I tried File.isFile, exists, canRead but they all return true even if the file download is still not complete.
probably because these calls have no way of knowing about any other programs that might hold the file open for writing. they check to see if the file is
there, which it is, or if you can
read from it, which you can. i know of no (easy) way of telling whether some other program entirely might be working on the file, short of file locking, but even that would require the other program to cooperate by acquiring a lock on the file first. it might not.