in reply to Filesize (-s) is consistenly reporting too small of size in Win32

I'm not clear what you mean by "WinXP" when you report the filesize. Is it possible that the file has one or more Additional Data Streams? Notepad can add an ADS, for example. These are not detected in the normal way, but it does depend on how you are measuring it. Perl -s, like most utilities, only reports the size of the primary $DATA stream. You mention dir in one of the posts, that does not show ADS files either. See Win32::StreamNames
  • Comment on Re: Filesize (-s) is consistenly reporting too small of size in Win32

Replies are listed 'Best First'.
Re^2: Filesize (-s) is consistenly reporting too small of size in Win32
by BrowserUk (Patriarch) on Jan 18, 2009 at 15:59 UTC

    This is very unlikely to be anything to do with streams.

    I don't think there is any way of obtaining a filesize that conflates the sizes of the different streams into a single number. For the most part streams have to treated as if they were entirely different files, whether you are reading them or querying information about them.

    The only APIs that treat them as compound entities are the backup APIs, and they are all but inaccessible to most user code.

    Despite all the OPs invective about hating windows, this is far more likely to be incompatibilities, or latency in catching, between the underlying Linux OS, the VMWare virtualisation and the hosted Windows code, than any inherent problem in Windows itself.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: Filesize (-s) is consistenly reporting too small of size in Win32
by wilsond (Scribe) on Jan 18, 2009 at 15:25 UTC

    "WinXP" meaning the "dir" command in Windows.

    Interesting. That's an idea, ain't it. The weirdness is that after I rebooted, the file sizes came out "normal". The file being tested was just a simple text file generated in Komodo on an Ubuntu box and stored via SMB on the Windows XP box. I doubt what happened is as you describe, but that's something else I will test for if it ever happens again. Thanks for that input.


    If you want to do evil, science provides the most powerful weapons to do evil; but equally, if you want to do good, science puts into your hands the most powerful tools to do so.
    - Richard Dawkins