Skip to content
Snippets Groups Projects
  1. Apr 08, 2020
  2. Feb 10, 2020
  3. Jul 23, 2019
    • Yorhel's avatar
      Handle malloc failure by pausing any activity · bb7b4196
      Yorhel authored
      This is a best-effort approach to save ncdu state when memory is low.
      There's likely allocation in libraries that isn't being checked
      (ncurses, printf).
      
      Fixes #132 (it actually doesn't, that needs a 64bit static binary too,
      but I'll get to that)
      bb7b4196
  4. Feb 04, 2019
  5. Jan 21, 2019
    • Alex Wilson's avatar
      add a max modified time, or mtime, view and sorting · 60fdac06
      Alex Wilson authored
      This adds an 'm' command to show the latest modified time of all files
      in a directory. The 'M' command allows for ascending and descending
      mtime sorting. These are only enabled with the -e flag and overload
      the dir_ext mtime field.
      60fdac06
  6. Jan 29, 2018
  7. Jan 23, 2018
    • Yorhel's avatar
      Display extended information in the info window · 3e6affa7
      Yorhel authored
      It's looking a bit cramped, but I'm lazy.
      3e6affa7
    • Yorhel's avatar
      Add support for optional "extended" information for each file/dir entry · 77aca35f
      Yorhel authored
      Unfortunately, there wasn't a single bit free in struct dir.flags, so I
      had to increase its size to 16 bit. This commit is just the initial
      preparation, there's still a few things to do:
      
      - Add "extended information" cli flag to enable/disable this
        functionality.
      - Export and import extended information when requested
      - Do something with the data.
      
      I also did a few memory measurements on a file list with 12769842 items:
      
        before this commit:    1.239 GiB
        without extended info: 1.318 GiB
        with extended info:    1.698 GiB
      
      It's surprising what adding a single byte to a struct can do to the
      memory usage. :(
      77aca35f
  8. Jan 21, 2018
  9. Jul 08, 2017
    • Yorhel's avatar
      Add support for colors and sprinkle some colors around · a369a43d
      Yorhel authored
      TODO:
      - Add (ls-like) colors to the actual file names
        -> Implement full $LS_COLORS handling or something simple and custom?
      - Test on a white/black terminal, and provide an alternate color scheme
        if necessary.
      - Make colors opt-in?
      a369a43d
  10. Aug 24, 2016
  11. Jan 22, 2014
  12. Jul 23, 2013
  13. Jan 13, 2013
  14. Nov 22, 2012
  15. Sep 06, 2012
  16. Aug 29, 2012
  17. Aug 27, 2012
    • Yorhel's avatar
      Use int instead of long for struct dir->items · a61c784b
      Yorhel authored
      2 billion files should be enough for everyone. You probably won't have
      enough memory to scan such a filesystem. int is a better choice than
      long, as sizeof(int) is 4 on pretty much any system where ncdu runs.
      a61c784b
    • Yorhel's avatar
      Use int64_t instead of off_t · 73690f8f
      Yorhel authored
      *Should* be equivalent, but having a clearly standardised width is much
      better.
      73690f8f
  18. Aug 26, 2012
    • Yorhel's avatar
      Split calc.c into separate components (dir_(mem|scan|common).c) · 0fd7dec7
      Yorhel authored
      The architecture is explained in dir.h. The reasons for these changes is
      two-fold:
      - calc.c was too complex, it simply did too many things. 399ccdeb is a
        nice example of that: Should have been an easy fix, but it introduced
        a segfault (fixed in 0b49021a), and added a small memory leak.
      - This architecture features a pluggable input/output system, which
        should make a file export/import feature relatively simple.
      
      The current commit does not feature any user interface, so there's no
      feedback yet when scanning a directory. I'll get to that in a bit.
      
      I've also not tested the new scanning code very well yet, so I might
      have introduced some bugs.
      0fd7dec7
  19. Jan 18, 2012
  20. Oct 31, 2011
  21. Feb 27, 2010
    • Yorhel's avatar
      Link hard linked files together with a circular linked list · 88cd199d
      Yorhel authored
      The directory sizes are now incorrect as hard links will be counted
      twice again (as if there wasn't any detection in the first place), but
      this will get fixed by adding a shared size field.
      
      This method of keeping track of hard links is a lot faster and allows
      adding an interface which lists the found links.
      88cd199d
    • Yorhel's avatar
      Copyright year bump · 101731ed
      Yorhel authored
      101731ed
  22. May 12, 2009
  23. May 11, 2009
    • Yorhel's avatar
      Use correct hard link information after partial recalculation or deletion · 6de0a8ec
      Yorhel authored
      Hard link detection is now done in a separate pass on the in-memory tree,
      and duplicates can be 'removed' and 're-added' on the fly. When making any
      changes in the tree, all hard links are re-added before the operation and
      removed again afterwards.
      
      While this guarantees that all hard link information is correct, it does
      have a few drawbacks. I can currently think of two:
      
       1. It's not the most efficient way to do it, and may be quite slow on
          large trees. Will have to do some benchmarks later to see whether
          it is anything to be concerned about.
      
       2. The first encountered item is considered as 'counted' and all items
          encountered after that are considered as 'duplicate'. Because the
          order in which we traverse the tree doesn't always have to be the
          same, the items that will be considered as 'duplicate' can vary with
          each deletion or re-calculation. This might cause confusion for
          people who aren't aware of how hard links work.
      6de0a8ec
  24. Apr 26, 2009
  25. Apr 23, 2009
  26. Apr 19, 2009
  27. Apr 18, 2009
  28. Apr 11, 2009
Loading