dhannotte has asked for the wisdom of the Perl Monks concerning the following question:

I just tried the copy() function from File::Copy and the copy of the file is larger than the original! Is there some flag I'm supposed to be setting? I'm running under Windows/XP. Thanks in advance.

Replies are listed 'Best First'.
Re: File::Copy problem
by ikegami (Patriarch) on Apr 02, 2010 at 03:38 UTC
    Are you perhaps copying from or to a handle rather than a file name? You might need to use binmode on the handle to remove layers that may transform the data.
      Sorry. My bad. File::Copy is working fine for me. I'll be more careful in the future to tone down the Chicken Little stuff.
Re: File::Copy problem
by Anonymous Monk on Apr 02, 2010 at 02:58 UTC
    Unlikely, how are you checking?
Re: File::Copy problem
by dwm042 (Priest) on Apr 02, 2010 at 18:01 UTC
    I don't know your hardware, and you didn't explain, but different hard disks can have different sector sizes if they're of different geometries. The consequence is that small files may not end up the same size on disk if they're copied from one file system to another.