Sean DiZazzo <[EMAIL PROTECTED]> wrote:

> On windows, this returns the size of the file as it _will be_, not the
> size that it currently is.  Is this a feature?  What is the proper way
> to get the current size of the file?  I noticed
> win32File.GetFileSize()  Does that behave the way I expect?
> 
> PS.  I also tried os.stat()[6]
> 

I think all of those will return the current size of the file, but that may 
be the same as the final size: just because the data hasn't been copied 
doesn't mean the file space hasn't been allocated. You don't say how you 
are copying the file, but I seem to remember that Windows copy command pre-
allocates the file at its final size (so as to reduce fragmentation) and 
then just copies the data after that.

If you need to make sure you don't access a file until the copy has 
finished then get hwatever is doing the copy to copy it to a temporary 
filename in the same folder and rename it when complete. Then you just have 
to check for existence of the target file.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to