Giter Site home page Giter Site logo

file sizes not good anymore about clifm HOT 4 CLOSED

muellerto avatar muellerto commented on May 28, 2024
file sizes not good anymore

from clifm.

Comments (4)

muellerto avatar muellerto commented on May 28, 2024 1
  1. Yes, may be. Probably it was me who did set ApparentSize false in the very beginning since it's comment was always "Linux only". And so it was at least for a year or so. I swear I didn't change it in the last weeks but the file size display changed recently. That was the reason for this issue.
  2. Yes, sure, I didn't claim that.
  3. du is mentioned in the comment of the ApparentSize option in my not very actual clifmrc. (I should finally get an actual one ...) I don't know how or if du is involved in anything at all but for the case it is I checked it's behavior.

After all the behavior seems to be correct in both cases, ApparentSize=true and ApparentSize=false. It was probably not right before when it showed indeed exact bytes for a long time with ApparentSize=false which has been the case on my machine until today. I always wanted exact bytes (we discussed this here and you implemented this feature) and suddenly not longer than a week ago I didn't have them anymore.

from clifm.

leo-arch avatar leo-arch commented on May 28, 2024

Looks like it's displaying actual disk usage (and your OS is reporting blocks of 1024k) instead of apparent sizes. What's the value of ApparentSize in your config file? By default it's set to true.

from clifm.

muellerto avatar muellerto commented on May 28, 2024

ApparentSize was false in my case.

When I set it true the file sizes get much better (I would say they are correct).

ApparentSize was always false on this machine. I didn't change it as far as I can remember. But the file size display changed recently. So either clifm or the OS or my MinGW du has changed it's behavior. But who?

My MinGW du supports the parameter --apperent-size. When I type du --apparent-size --bytes *.* I get the exact sizes I want to have. But I get exactly the same correct results when I type du --bytes *.*. When I type du *.* I get kilo bytes, OK, but even these numbers are different from what clifm shows. In my picture above clifm shows both MainPage.html files as 8192 bytes while du says one file has 8 kB, the other one has 6 kB. Mysterious.

I let ApparentSize be true as long as I don't see problems with that. Thanks for the lead on that.

from clifm.

leo-arch avatar leo-arch commented on May 28, 2024

Glad it's working again. Just a few remarks:

  1. ApparentSize has always been set to true by default. There has been no change in this regard as far as I can remember.
  2. Clifm will never modify the user's config file, even if some option is set to a wrong value.
  3. du(1) is not involved here at all: file sizes are computed using the values returned by the stat(2) syscall (du is only used to get directories size recursively, for example, when you run pp on a directory).

Please keep me informed about any unusual or unexpected behavior.

EDIT: Nope, it seems I was wrong: ApparentSize was originally set to false. However, the important thing is whether sizes are displayed correctly or not, i.e. respecting the user's settings.

As far as I can tell, the sizes shown in your screenshot are correct (file disk usage in blocks of 1024 bytes, which is Cygwin default block size (see the S_BLKSIZE macro in sys/stat.h)). Also, setting ApparentSize to true produced the right change: actual file sizes instead of disk usage. In any case, if these values were different before, without altering the value of ApparentSize, it was a clifm bug that has been fixed.

EDIT2: Made a few tests on my Windows box. ApparentSize was actually set to false; nonetheless, file sizes were as expected. Tried with both the latest version and 1.13.

from clifm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.