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

My file has 788 lines, including the final blank line in the file.

  • Comment on Re^2: Filesize (-s) is consistenly reporting too small of size in Win32

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

      I rebooted my WinXP box and now everything looks fine. **ARGH** I hate Windows. Why would a reboot fix it? I don't know what the problem was at all. It was consistently failing, now it's consistently not failing. In any case, I appreciate your help.


      Nature is not cruel, pitiless, indifferent. This is one of the hardest lessons for humans to learn. We cannot admit that things might be neither good nor evil, neither cruel nor kind, but simply callous — indifferent to all suffering, lacking all purpose.
      - Richard Dawkins
        I rebooted my WinXP box and now everything looks fine. **ARGH** I hate Windows. Why would a reboot fix it?

        Might it be a virus? It's Windows after all.


        I'm not really a human, but I play one on earth Remember How Lucky You Are

      Just a thought... "dir" in Windows doesn't cache, does it? That's the only possible thing I can think of. I was careful to be sure that I was testing against the same filename in "dir" and "-s".


      Nature is not cruel, pitiless, indifferent. This is one of the hardest lessons for humans to learn. We cannot admit that things might be neither good nor evil, neither cruel nor kind, but simply callous — indifferent to all suffering, lacking all purpose.
      - Richard Dawkins
        Just a thought... "dir" in Windows doesn't cache, does it?

        Nope. The file may (probably is given its small size) cache in the file system cache, but there is no way for it to be updated without the cache being flushed. If that were possible, we (and the world) would have heard about it long ago.

        And there is no way that a re-boot fixed it, cos there's no way for the OP scenario to happen. Perl, dir, explorer and every other program that will show you the size of the file queries that information using the same system API.

        The only possibility that I can think of to explain what you saw is that the file was updated between obtaining the two figures--but that doesn't sit well with your "consistantly" claim.

        Think about it. XP has been around for 7 years. Perl has run on Win32 for 10+ years. If this was a possibilty, someone (else) would have noticed it by now.


        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.