Yorhel
f83ed07fcf
Don't include "notreg" field for excluded/error'd files in export
...
+ some comment fixes.
2012-08-29 11:52:52 +02:00
Yorhel
968471f602
Omit "dev" field in export when same as parent dir + "excluded" fix
2012-08-29 11:43:10 +02:00
Yorhel
c4616ff186
Added simple error checking & handling when exporting
2012-08-29 10:27:12 +02:00
Yorhel
7ccb98006a
Support exporting to stdout while still allowing -u 2 to work
2012-08-29 10:26:37 +02:00
Yorhel
9d341950ff
dir_common.c: Don't display total size when it's not known
...
The total size isn't calculated when exporting to a file.
2012-08-29 09:23:32 +02:00
Yorhel
59a9c6b877
Added -o option to export dir structure to a JSON-encoded file
...
!WARNING! The export option is experimental, and the file format is not
final. I make no promise that a future version of ncdu will be able to
read the current format. There's also quite a few TODO's left.
2012-08-28 17:22:33 +02:00
Yorhel
2e1838d890
Get rid of padding in dir struct + use offsetof() to calc needed size
...
There used to be four bytes of padding in the struct on systems with
32bit pointers. Moving the pointers down so that they are in between the
64bit and 32bit fields means that there'll never be any padding.
There may, however, be some extra padding at the end of the struct to
make the size a multiple of 8. Since we use the name field as a sort of
"flexible array member", we don't particularly care about that padding
and just want to allocate enough memory to hold the struct and the name
field. offsetof() allows us to do that without relying on compiler
support for flexible array members.
2012-08-28 09:22:46 +02:00
Yorhel
dfbeed9daf
Fixing some whitespace issues
2012-08-27 21:51:08 +02:00
Yorhel
21c056f51d
Use uint64_t instead of dev_t as well + added comment explaining this
2012-08-27 21:10:07 +02:00
Yorhel
cabb55290d
Use uint64_t instead of ino_t
...
POSIX defines ino_t to be of an unsigned integer type, and searching
around the net didn't tell me of any definitions conflicting that. So
every ino_t can be represented in an uint64_t. (Assuming that is the
largest integer type in use for an inode number, but I'm sure that
assumption will hold for a while)
(dev_t, on the other hand, is a bit messier. Still figuring out what to
do with that.)
2012-08-27 19:12:13 +02:00
Yorhel
a61c784b8c
Use int instead of long for struct dir->items
...
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.
2012-08-27 18:34:45 +02:00
Yorhel
73690f8f83
Use int64_t instead of off_t
...
*Should* be equivalent, but having a clearly standardised width is much
better.
2012-08-27 17:20:24 +02:00
Yorhel
44e63ce2e7
Added -u option to change the scan UI
...
This allows scanning stuff without initializing ncurses. Not too useful
at this point since ncdu will switch to an ncurses environment when it's
done anyway, but this will become more useful when the export-to-file
feature has been implemented.
2012-08-27 14:17:40 +02:00
Yorhel
e380805990
Fixed some compiler warnings and a (rather nonexistent) memory leak
...
This silences clang and gcc with -O2 -Wall -Wextra
2012-08-26 18:12:13 +02:00
Yorhel
5064b4d651
Re-added scanning UI and improved error handling
2012-08-26 17:08:10 +02:00
Yorhel
0fd7dec7b0
Split calc.c into separate components (dir_(mem|scan|common).c)
...
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.
2012-08-26 15:29:55 +02:00
Chris West (Faux)
0b49021a6c
399ccdeb caused a crash on non-existent directories on the command line
2012-08-21 17:16:28 +01:00
Yorhel
399ccdeb47
calc.c: Fix path display when scanning an empty directory
...
http://dev.yorhel.nl/ncdu/bug/15
2012-08-18 09:21:33 +02:00
Yorhel
832b91b033
Make width of scan error screen dynamic as well
2012-08-18 08:55:51 +02:00
Yorhel
a87e90c3c2
main.c: Revert nodelay() status after calling ncresize()
...
This fixes a bug where ncdu would stop scanning a directory if the
terminal window has been resized to a small enough space that the
warning would show up.
2012-08-18 08:47:39 +02:00
Yorhel
9c9d466752
Make width of the scanning screen dynamic based on terminal width
...
http://dev.yorhel.nl/ncdu/bug/13
2012-08-18 08:46:48 +02:00
Yorhel
10e560a9a6
Use top-level automake build + removed AUTHORS, INSTALL and NEWS
...
A more modern and practical structure.
2012-05-21 15:38:08 +02:00
Yorhel
7fcae11d4d
Copyright year bump
...
Damn, it's 2012 already.
2012-01-18 11:40:50 +01:00
Yorhel
5243e2daf4
Code cleanup: Use `static' where applicable.
...
This should also allow compilers to generate better code.
2011-10-31 15:09:49 +01:00
Yorhel
dabe97f9c2
Use hash table when detecting hard links
...
This should be a *significant* performance increase when scanning a
directory that has many hard links.
I used the khash library written by Attractive Chaos[1]. This library
fits perfectly into ncdu's "use as little memory as possible but still
try to be very fast"-policy. It's API is somewhat quircky in use, but I
guess that is to blame to the lack of generic programming support in C.
Blog: http://attractivechaos.wordpress.com/
Lib: https://github.com/attractivechaos/klib/blob/master/khash.h
2011-10-31 14:47:39 +01:00
Yorhel
00bd015d79
Belated copyright year bump
2011-10-31 14:47:15 +01:00
Yorhel
53e3bcbd2b
browser.c: Added [read-only] indication to title bar
2011-10-31 13:10:36 +01:00
Yorhel
260f138d3f
util.c: Use KiB instead of kiB (bug #3399279 )
2011-09-09 08:57:10 +02:00
Rodolfo Borges
57164c8ca6
read-only flag
2011-09-09 08:47:41 +02:00
Yorhel
3860ba217b
Display size graph by default
...
This used to be the default before 1.5, but for some reason the default
changed in 1.5 and 1.6. Changing it back now, because the graph really
is useful, and there's still enough space for the filename even in
smaller terminals.
2010-08-13 11:38:27 +02:00
Yorhel
9f7bc01f11
Fixed segfault when launched on a nonexistant directory
...
Forgot to check the return value of path_absolute() in path_real(),
path_absolute() would return an error when getcwd() fails.
Fixes bug #3012787 .
2010-07-19 12:45:33 +02:00
Yorhel
791612dc4d
browser.c: Got rid of the 'line' format string
...
This solution is far cleaner. Thanks to Ben North for pointing me to the
*-width-specifier that has apparently been built into the printf-family
functions for, well, quite a while, it seems.
2010-07-18 18:58:22 +02:00
Yorhel
d942a0ebc6
Only create the line format once when drawing the browser window
...
The memory for this format is now statically allocated as well. I
was under the impression its size would depend on wincols, but this is
the format we're talking about, the string does not have to hold the
actual line contents. I must have been sleeping again...
Oh well, this is a slight performance improvement, although it doesn't
seem the be the cause of the browing slowness when running under
valgrind. (Obviously running ncdu with valgrind is supposed to be
slower, but the current performance is rather bad...)
2010-04-28 17:15:46 +02:00
Yorhel
f18bd86ab8
Got rid of segfault when the root dir only contains hidden files
...
Instead you now get the usual 'no items to display' message when hiding
hidden files in the root directory.
2010-04-28 15:48:57 +02:00
Yorhel
d7d782be1c
Reset descending/ascending order when changing sort column
...
This changes the behaviour back to it was before the dirlist
abstraction, which is the behaviour I prefer.
2010-04-28 15:39:45 +02:00
Yorhel
6fa56c1b38
Store the name of the item in the dir struct itself
...
Rather than storing a pointer to another memory allocation in the
struct. This saves some memory and improves performance by significantly
decreasing the number of calls to [c|m]alloc() and free().
2010-04-28 15:32:47 +02:00
Yorhel
b7ccf78b90
More intuitive multi-page browsing
...
Here is the new multi-page listing functionality I promised in
5db9c2aea1 .
It may look very easy, but getting this to work right wasn't,
unfortunately.
2010-04-28 13:32:30 +02:00
Yorhel
c68a229e09
Fixed buffer overflow when some directories can't be scanned
...
Also changed other occurences of the same situation to use the same
checking method (>= rather than a +1) for consistency.
Fixes bug #2981704 .
2010-04-28 10:08:45 +02:00
Yorhel
79733f7d64
Determine which item to select after deletion in browser.c
...
Rather than the ugly hack in delete.c.
2010-04-27 17:58:17 +02:00
Yorhel
eed949d48d
Changed directory listings to a doubly linked list
...
This significantly improves the performance when browsing large
directories. It is somewhat costly on the memory usage, though. :-(
2010-04-27 17:18:56 +02:00
Yorhel
c84e70b627
Properly fixed crash on browsing dirs with a small window size
...
I was overseeing a stupid mistake in
a7b7841ac0
Obviously, you need to check against wincols and not winrows...
2010-04-27 13:27:57 +02:00
Yorhel
f078cb6bc7
Properly free() the pattern in exclude_clear()
...
Fixes a tiny, insignificant memory leak.
2010-04-27 12:49:12 +02:00
Yorhel
a7b7841ac0
Fixed crash on browsing dirs with a small window size
...
Fixes bug #2991787
2010-04-27 12:41:01 +02:00
Yorhel
a35f998168
Don't select first item when browsing back using parent dir
...
The parent directory reference is the same for all directories, so we'll
have to make sure to reset its FF_BSEL flag when opening another
directory.
2010-04-27 12:27:24 +02:00
Yorhel
5db9c2aea1
Abstracted dir list handling from browser.c into dirlist.c
...
This optimizes a few actions (though not all), and makes the code easier
to understand and expand.
The behaviour of the browser has changed a bit with regards to
multi-page listings. Personally I don't like this change much, so I'd
probably fix that later on.
2010-03-07 11:10:00 +01:00
Yorhel
fe21608e98
Correctly update directory sizes upon removing a hard link
2010-03-03 14:40:56 +01:00
Yorhel
1cc0e5a50f
Only count the size of each hard link once for each directory
...
The displayed directory sizes are now fully correct, although in its
current state it's not all that intuitive because:
directory size != sum(size of all files and subdirectories)
This should probably be fixed later on by splitting the sizes into a
shared and non-shared part.
Also, the sizes displayed after a recalculation or deletion are
incorrect, I'll fix this later on.
2010-02-28 16:56:45 +01:00
Yorhel
82ec5b9fa8
Misc. minor fixes
2010-02-28 10:13:12 +01:00
Yorhel
93a97381bd
List detected links in a separate tab in info window
2010-02-27 15:21:25 +01:00
Yorhel
88cd199d94
Link hard linked files together with a circular linked list
...
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.
2010-02-27 15:21:25 +01:00
Yorhel
101731ed13
Copyright year bump
2010-02-27 15:20:57 +01:00
Yorhel
06cab8cc30
Added some keybindings and changed 'h' to 'e' in browser
2009-10-18 12:52:00 +02:00
Yorhel
adaf8a6098
Call setlocale() at initialization
...
This (in combination with linking to ncursesw) fixes the display of
non-ASCII characters.
2009-10-18 12:05:36 +02:00
Yorhel
b7d59bee5b
Properly display MiB units instead of MB
...
Fixes bug #2831412 (debian #539553 )
2009-08-03 14:26:10 +02:00
Yorhel
26c77cfc14
Return to previously opened directory on failed recalculation
...
...instead of displaying an empty and unusable browser.
2009-06-06 23:26:05 +02:00
Yorhel
e5cc7703d7
Properly free return value of opendir() on calculation interrupt
...
When interrupinting the calculation process by pressing 'q' while
it's looping through a directory, or when a directory could be openend
but not chdir()'ed into, closedir() wasn't called.
2009-06-06 23:22:30 +02:00
Yorhel
21f2e62793
Removed another occurence of dirfd()
...
This fixes a tiny memory leak as well, as the return value of opendir()
wasn't passed to a closedir() after use.
2009-06-06 21:04:47 +02:00
Yorhel
e5dccc1719
Don't call link_del() on free'd memory
2009-06-06 20:43:52 +02:00
Sebastian Kayser
3d8751b495
Fixed non-void return in void delete_process()
...
Fixes bug #2789781 .
2009-05-16 10:36:03 +02:00
Yorhel
a0bf6deebb
Removed reliance on dirfd()
2009-05-16 10:20:58 +02:00
Yorhel
aef88fb773
Removed the ST_QUIT state
...
There shouldn't be a need for such a state when there's a central
place where the program execution keeps returning to.
2009-05-12 19:06:15 +02:00
Yorhel
9d07027553
calc.c: Removed an unused variable in calc_item()
2009-05-12 18:39:00 +02:00
Yorhel
2828bfe6a8
util.h: Typo in function declaration
2009-05-12 18:37:49 +02:00
Yorhel
06a5f5215f
Properly select the next item after deletion
...
Setting FF_BSEL after calling browse_init() causes two items to be
selected, as browse_init() makes sure something will be selected,
while calc_process() assumes nothing is, because the previously
selected item had just been deleted.
2009-05-11 20:14:52 +02:00
Yorhel
6de0a8ec00
Use correct hard link information after partial recalculation or deletion
...
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.
2009-05-11 20:02:46 +02:00
Yorhel
8209a7efe3
Allocate correct amount of memory for the links list
...
I happen to make these kinds of mistakes a lot, for some strange
reason. Maybe I should just get more sleep...
2009-05-05 19:33:30 +02:00
Yorhel
fd984e754c
Added hard link indicator in browser and help window
2009-05-05 19:25:52 +02:00
Yorhel
757bdff7ed
Implemented hardlink detection
2009-05-05 19:13:52 +02:00
Yorhel
d571c080b5
Fixed a browsing bug related to hiding items
...
Reproducable with the following steps:
- Make sure the first item in the list is a directory starting with a dot
- Make sure the next item is a normal directory
- Select first item
- Press 'h' to hide it, next item will properly be selected
- Open selected directory (right arrow), and see how the first (hidden)
directory was opened.
It's amazing how I've even found this bug, considering that really is the
only way to reproduce it...
2009-05-02 13:01:12 +02:00
Yorhel
f416a7a121
Removed powers of 1000/1024 toggle from help.c
2009-05-02 12:40:53 +02:00
Yorhel
4ea817568f
Use absolute path for matching excluded items
2009-05-02 10:45:33 +02:00
Yorhel
46de3510cd
Fixed buffer overrun in calc.c
2009-05-02 10:21:29 +02:00
Yorhel
0fe0d11e3b
Don't divide by zero when size of parent dir = 0
...
It's a floating point division, so won't really cause any real problems
on most systems. Still, a percentage of 'nan' isn't really useful.
2009-05-01 09:07:28 +02:00
Yorhel
95b314de73
Fixed line width when displaying 100%
...
Which would happen if there's only one file is in a directory
2009-05-01 09:00:59 +02:00
Yorhel
3610121dab
Don't try to delete a directory that's not empty
2009-04-28 11:07:24 +02:00
Yorhel
ae14721c5f
Fixed segfault after aborting calculation
...
I really, really, wasn't think when writing commit
91b131a080
2009-04-26 15:23:09 +02:00
Yorhel
eb3310060f
Fixed display bug on deletion error
2009-04-26 14:57:20 +02:00
Yorhel
2a5c9a242f
Fixed display of one-component-after-root directory
...
Bug introduced in ece21a668d
It's amazing how many mistakes one person can make in a few hours.
2009-04-26 13:26:20 +02:00
Yorhel
91b131a080
Fixed segault after finishing calculation
...
Bug introduced in 796d043c0d
Apparently I was still sleeping or something...
2009-04-26 13:15:53 +02:00
Yorhel
ece21a668d
Fixed display of the root directory
2009-04-26 13:10:00 +02:00
Yorhel
9cc79b0fab
Properly call calc_leavepath() on error
2009-04-26 12:58:22 +02:00
Yorhel
796d043c0d
Fixed bug with opening the root directory
2009-04-26 12:55:27 +02:00
Yorhel
219ae8a6db
Removed useless call to path_real()
2009-04-26 12:45:42 +02:00
Yorhel
ceecccc3ae
Move cursor to the correct line in browse_draw()
2009-04-26 11:22:24 +02:00
Yorhel
43fec63281
Removed last occurence of PATH_MAX
...
And it wasn't even used for a path, but for a row on the screen...
2009-04-26 11:18:45 +02:00
Yorhel
290c7a7d70
Renamed ncdu.h to global.h and #included all other header files into that
...
So we're actually back to having one header file for everything,
except it's now maintainable.
2009-04-26 11:08:40 +02:00
Yorhel
4b6456d0b9
Improved deletion performance
2009-04-26 10:54:14 +02:00
Yorhel
f6e34e520e
Don't re-sort when pressing the browse keys without affecting the dir
2009-04-26 09:55:23 +02:00
Yorhel
ba243df042
Centralized screen update delay into input_handle()
2009-04-26 09:49:51 +02:00
Yorhel
8ddec92724
Huge performance improvement with the calculation
2009-04-26 09:35:16 +02:00
Yorhel
c079e0d23a
Fixed another memory allocation issue
2009-04-25 16:30:59 +02:00
Yorhel
027c0c2eba
Don't segfault when browsing an empty dir...
2009-04-25 15:46:00 +02:00
Yorhel
3dc21365f5
Fixed another PATH_MAX reliance in calc.c
...
Make sure not to pass the absolute root directory to lstat() and
chdir(), as these functions can't handle long path names.
2009-04-25 14:31:54 +02:00
Yorhel
c432928bd2
Fixed subdirectory name after refresh and a tiny memory leak
2009-04-25 14:29:20 +02:00
Yorhel
2738177fff
Fixed memory overflow bug in path_real_rec()
2009-04-25 14:26:52 +02:00
Yorhel
1f341f8b4c
Fixed segfault on specifying an empty dir
2009-04-25 12:11:53 +02:00
Yorhel
18211ebe2e
Properly chdir() before lstat()
2009-04-25 11:49:20 +02:00
Yorhel
00217dd86e
Fixed segfault on specifying a dir to process from cli
2009-04-24 18:18:17 +02:00
Yorhel
124296ee19
Fixed infinite calc_process() on error
2009-04-24 18:17:34 +02:00
Yorhel
731bfccfb5
Removed PATH_MAX reliance in main.c
2009-04-23 22:12:50 +02:00
Yorhel
5c6f057840
Fixed a few occurences of wrong arguments for getpath()
...
That's what you get when you change the way a function works...
2009-04-23 22:03:24 +02:00
Yorhel
4bb7d6b7c2
Removed reliance on PATH_MAX on most places
...
ncdu already does seem to handle longer paths now, though there are
still a few places where the code still relies on PATH_MAX. Will fix
those later.
2009-04-23 21:15:11 +02:00
Yorhel
bb7119c642
main.c should include help.h
2009-04-23 20:47:01 +02:00
Yorhel
7698bfd980
Split path handling into path.c and replaced rpath() with a better implementation
...
This is the first step into replacing all code that relies on PATH_MAX,
more changes will follow.
2009-04-23 19:44:37 +02:00
Yorhel
d75cc8fb72
Replace 'suseconds_t' with 'long'
...
suseconds_t isn't always defined on some systems, but all possible
values are guaranteed to fit into a long, so use that.
2009-04-19 14:29:49 +02:00
Yorhel
97fefbaffb
Disabled blocking wait for user input while deleting
...
...that was for debugging, which isn't necessary anymore.
2009-04-19 13:17:21 +02:00
Yorhel
a71bc36860
Select next item after deleting
...
This makes deleting multiple files a -lot- easier...
2009-04-19 13:16:31 +02:00
Yorhel
44f64cf3d3
Go the correct directory after a deletion
2009-04-19 13:02:02 +02:00
Yorhel
bb8c2e66e7
freedir() shouldn't need to return anything
2009-04-19 12:47:22 +02:00
Yorhel
d8058362ec
Actually delete parents as well when deleting directories
2009-04-19 12:43:25 +02:00
Yorhel
ba4d06e09e
(partly) rewrote delete.c for the new framework and re-added the deletion feature
2009-04-19 11:38:35 +02:00
Yorhel
daba2128fc
Don't quit ncdu when pressing 'q' while the info window is shown
...
Just hide the info window in that case.
2009-04-19 10:06:33 +02:00
Yorhel
6568a962bc
Converted help.c to the new framework and re-added help window
2009-04-19 10:03:42 +02:00
Yorhel
76a2530579
Fixed bug in calculation window title
2009-04-19 09:45:27 +02:00
Yorhel
8daeeea1d9
Re-added file information window in browser.c
2009-04-18 16:02:46 +02:00
Yorhel
ddd8a639b7
Only sort directory when necessary
2009-04-18 15:45:58 +02:00
Yorhel
33cd126197
Draw browser on background while calculating
2009-04-18 15:35:37 +02:00
Yorhel
42ca499730
Allow drawing the browser frame when there's no directory structure
2009-04-18 15:34:47 +02:00
Yorhel
e079026ac8
Kept internal variables internal in browser.c and added browse_init()
...
Looks much better this way!
2009-04-18 15:23:33 +02:00
Yorhel
3ad39f3741
Don't touch the original tree while recalculating
...
This change makes it possible to still show the browser with correct
(previous) data while calculating.
2009-04-18 15:07:23 +02:00
Yorhel
4a751f0564
Removed stcalc and used several global variables instead
...
Considering it's now all internal in calc.c, anyway.
2009-04-18 14:36:24 +02:00
Yorhel
372f69853c
Initialize calc_delay and calc_smfs in calc.c rather than main.c
2009-04-18 14:16:48 +02:00
Yorhel
ca11083385
Moved minimum screen size handling to main.c
...
And with that, finally managed to get rid of sflags in ncdu.h
2009-04-18 14:12:30 +02:00
Yorhel
b24c3dee40
Got rid of SF_SI
...
It was a totally useless feature, anyway.
2009-04-18 14:05:45 +02:00
Yorhel
2b209ba9b2
Moved SF_SMFS in ncdu.h to char calc_smfs in calc.h
...
Another code cleanup, many more to come...
2009-04-18 14:04:53 +02:00
Yorhel
2a25bfdc7a
Moved and renamed sdelay in ncdu.h to calc_delay in calc.h
...
Because that's where it's supposed to be.
(geez, the current code is still a mess)
2009-04-18 13:51:45 +02:00
Yorhel
05756ad567
Remove some calc.c specific defines from ncdu.h
...
And updated TODO a bit
2009-04-18 13:45:32 +02:00
Yorhel
6d5ae5eb76
Fixed minor size + item count inconsistency on recalculating a dir
...
Namely, the 'parent' dir item itself that is recalculated isn't
reconsidered in its parents.
2009-04-16 19:05:11 +02:00
Yorhel
d297af2ce8
Fixed major bug with counting all sizes twice
...
I have absolutely no idea when I introduced this bug, will check
the history later.
2009-04-16 19:00:13 +02:00
Yorhel
34ba5348c8
Made stcalc static within calc.c and abstracted access to it with calc_init()
...
This actually makes the struct itself obsolete, as all information is now only
useful within calc.c itself and other files don't have to do anything with it.
2009-04-16 18:26:39 +02:00
Yorhel
5790b817f9
Re-added recalculating (sub)directories
2009-04-13 19:32:40 +02:00
Yorhel
b8877be907
Fixed display bug while calculating
2009-04-13 18:38:07 +02:00
Yorhel
7a0730f5d2
(Partly) rewrote browser.c to the new system
...
Not fully finished yet with this one, though.
2009-04-13 17:25:46 +02:00
Yorhel
fb7b9f94df
util.c:freedir() doesn't have to do anything with the selected flag
2009-04-11 14:16:51 +02:00
Yorhel
690eb3f593
Header file cleanup
...
Moved everything that doesn't belong in ncdu.h into the other header
or c files. Looks much better this way.
2009-04-11 13:49:08 +02:00
Yorhel
fa90c77c96
Rewrote util.h to the new style
2009-04-11 11:38:36 +02:00
Yorhel
b10a0f536f
Removed ncdu.h dependency from exclude.c
2009-04-11 10:53:39 +02:00
Yorhel
6c0a56a26f
Rewrote exclude.c to the new style
2009-04-11 10:53:13 +02:00
Yorhel
cc8cc99213
Moved definitions for calc.c to separate header file
...
Though it's not really useful yet now ncdu.h still includes it
2009-04-11 10:04:24 +02:00
Yorhel
c4be23a4c5
Each state can have it's own global variable
2009-04-11 09:58:33 +02:00
Yorhel
f392bf3ee1
Rewrote calc.c in the new style & framework
...
ncdu is currently pretty much in a non-working state, but things will
get fixed eventually after porting the other source files to the new
framework.
2009-04-10 18:16:33 +02:00
Yorhel
02705d2c7f
Renamed parseCli() and added argument for root dir
2009-04-08 19:40:18 +02:00
Yorhel
a0252cb0f2
Removing extern keyword from function declarations
...
Because that's the default, anyway.
2009-04-08 19:37:24 +02:00
Yorhel
c89686a8ab
Defined the first states in ncdu.h
2009-04-08 19:09:24 +02:00
yorhel
e7fb90fc67
Year bump
...
git-svn-id: svn://blicky.net/ncdu/trunk@48 ce56bc8d-f834-0410-b703-f827bd498a76
2009-01-11 09:34:19 +00:00
yorhel
20296b2567
Fixed rpath() bug on /.
...
git-svn-id: svn://blicky.net/ncdu/trunk@47 ce56bc8d-f834-0410-b703-f827bd498a76
2009-01-11 09:30:53 +00:00
yorhel
ca7ae5c142
Items are ordered by displayed size rather than disk usage
...
git-svn-id: svn://blicky.net/ncdu/trunk@46 ce56bc8d-f834-0410-b703-f827bd498a76
2008-12-11 17:13:03 +00:00
yorhel
c050d775d5
Size graph uses the apparent size if that is displayed
...
git-svn-id: svn://blicky.net/ncdu/trunk@45 ce56bc8d-f834-0410-b703-f827bd498a76
2008-12-11 17:07:55 +00:00
yorhel
6f2d258354
Pressing q while the info box is shown now hides the box, instead of quiting ncdu
...
git-svn-id: svn://blicky.net/ncdu/trunk@44 ce56bc8d-f834-0410-b703-f827bd498a76
2008-10-19 08:02:02 +00:00
yorhel
57be9e2905
Current directory is assumed when no directory is given on the commandline (more du-like), and give a proper error if a given dir exceeds PATH_MAX
...
git-svn-id: svn://blicky.net/ncdu/trunk@43 ce56bc8d-f834-0410-b703-f827bd498a76
2008-10-10 10:56:48 +00:00
yorhel
fec2f9a1c0
Made browse keys work when file information window is displayed
...
git-svn-id: svn://blicky.net/ncdu/trunk@42 ce56bc8d-f834-0410-b703-f827bd498a76
2008-09-20 09:35:21 +00:00
yorhel
01f9a1f552
Fixed incorrect apparent size on directory refresh
...
git-svn-id: svn://blicky.net/ncdu/trunk@41 ce56bc8d-f834-0410-b703-f827bd498a76
2008-09-17 16:40:39 +00:00
yorhel
04b7032846
Decided to get rid of that startup window...
...
git-svn-id: svn://blicky.net/ncdu/trunk@40 ce56bc8d-f834-0410-b703-f827bd498a76
2008-09-10 15:14:12 +00:00
yorhel
4fdebc82d5
Added spaces around the path in browser.c (debian bug #472194 )
...
git-svn-id: svn://blicky.net/ncdu/trunk@38 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 18:29:35 +00:00
yorhel
c306d3fe3b
Updated copyright year to cover 2008 as well
...
git-svn-id: svn://blicky.net/ncdu/trunk@36 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 13:59:58 +00:00
yorhel
a4480b9523
Got rid of the FF_PAR hack
...
git-svn-id: svn://blicky.net/ncdu/trunk@35 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 13:43:39 +00:00
yorhel
9e2eb51ef4
Moved cursor to selected items in browser and deletion dialog for improved accessibility
...
git-svn-id: svn://blicky.net/ncdu/trunk@34 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 13:31:21 +00:00
yorhel
cd2ade76c6
Included patch from Cygwin package: Fix crash on names with slashes from /proc/registry
...
git-svn-id: svn://blicky.net/ncdu/trunk@33 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 11:14:48 +00:00
yorhel
6621d70d99
Removed export and import code from trunk and created separate development branch.
...
git-svn-id: svn://blicky.net/ncdu/trunk@32 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 09:37:49 +00:00
yorhel
1313c268dd
Updated ncdu -h
...
git-svn-id: svn://blicky.net/ncdu/trunk@31 ce56bc8d-f834-0410-b703-f827bd498a76
2007-11-24 08:54:22 +00:00
yorhel
6b05cc9f72
Bugfix: total disk usage and apparent size in the status bar were always equal
...
git-svn-id: svn://blicky.net/ncdu/trunk@30 ce56bc8d-f834-0410-b703-f827bd498a76
2007-11-02 19:22:20 +00:00
yorhel
abeb59fe30
Bugfix for systems that don't have an S_BLKSIZE of 512
...
git-svn-id: svn://blicky.net/ncdu/trunk@29 ce56bc8d-f834-0410-b703-f827bd498a76
2007-11-02 11:44:18 +00:00
yorhel
8a71f8860c
Fixed buffer overflow when supplying a path longer than PATH_MAX (patch by Tobias Stoeckmann)
...
git-svn-id: svn://blicky.net/ncdu/trunk@28 ce56bc8d-f834-0410-b703-f827bd498a76
2007-11-01 19:40:30 +00:00
yorhel
db920f8dab
* Added error handling for the import feature
...
* Created own window-functions and removed ncurses window usage
* Rewrote fullsize
git-svn-id: svn://blicky.net/ncdu/trunk@27 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-16 08:36:58 +00:00
yorhel
96d0ffffa2
The "reference to parent directory" hack is now only used in drawBrowser in browser.c, and is not included in the main dir structure anymore. (less code, easier, faster, less memory usage)
...
git-svn-id: svn://blicky.net/ncdu/trunk@26 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-12 09:52:24 +00:00
yorhel
55405140f7
* (BETA) Implemented file list exporting and importing
...
* Added file format specification (README.fileformat)
* Moved settingsCli in settings.c to parseCli in main.c
* Bugfix: drawError in calc.c was not shown when an error occurred while reading the main dir
git-svn-id: svn://blicky.net/ncdu/trunk@25 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-11 20:01:16 +00:00
yorhel
70f7adecda
Fixed version in ncdu.1, and filenames ending with a tilde are now also hidden with the 'h'-key
...
git-svn-id: svn://blicky.net/ncdu/trunk@24 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-07 09:38:54 +00:00
yorhel
4654bb93c4
Two small bug fixes: interface bug in the delete progress, and getpath returned double slash on root
...
git-svn-id: svn://blicky.net/ncdu/trunk@22 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-05 11:12:40 +00:00
yorhel
66bdf71f97
Documented the 'a' and 'i'-keys, help window is more dynamic and updated TODO
...
git-svn-id: svn://blicky.net/ncdu/trunk@21 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-05 10:23:18 +00:00
yorhel
ce53b81dc5
Configure checks for ncurses.h, fixes bug #1764304
...
git-svn-id: svn://blicky.net/ncdu/trunk@20 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-02 08:21:11 +00:00
yorhel
2a9b34ce2d
* Added 'a'-key to toggle between showing apparent size and disk usage
...
* Added 'i'-key to show a small window containing info on the selected item
* Cleaned up file flags and browse flags
git-svn-id: svn://blicky.net/ncdu/trunk@19 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-01 15:01:42 +00:00
yorhel
fa0aa6b53b
* Calculate both apparent size and disk usage
...
* Removed apparent sizes option
* Combined "files" and "dirs" to "items" in the dir structure
* Updated TODO
git-svn-id: svn://blicky.net/ncdu/trunk@18 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-01 13:17:26 +00:00
yorhel
4859bc8810
Documented the refresh feature and made some improvements in the help window
...
git-svn-id: svn://blicky.net/ncdu/trunk@17 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-29 14:53:12 +00:00
yorhel
b2b43689f0
Preperations for the export feature: re-ordered the file flags and removed FF_OTHER (which is the same as \!(FF_DIR | FF_FILE))
...
git-svn-id: svn://blicky.net/ncdu/trunk@16 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-29 14:06:05 +00:00
yorhel
62f1293b89
Fixed a few compiler warnings and added a TODO list
...
git-svn-id: svn://blicky.net/ncdu/trunk@15 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-29 10:50:48 +00:00
yorhel
614134b59b
Items will not be unnecessarily resorted when they are already in the correct order
...
git-svn-id: svn://blicky.net/ncdu/trunk@14 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-27 07:52:50 +00:00
yorhel
c96bf1636a
Changed struct dir from a doubly to a singly linked list (less memory usage, faster, and easier)
...
git-svn-id: svn://blicky.net/ncdu/trunk@13 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-26 16:37:33 +00:00
yorhel
362554d2ac
Added 'r' key to refresh the current directory
...
git-svn-id: svn://blicky.net/ncdu/trunk@11 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-26 12:56:24 +00:00
yorhel
ce6785124c
Rewrote calc.c to be more flexible and clarifying, and changed the global 'dir' to a pointer
...
git-svn-id: svn://blicky.net/ncdu/trunk@10 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-25 18:38:49 +00:00
yorhel
b53cb427a4
The 'h' key now also hides excluded items
...
git-svn-id: svn://blicky.net/ncdu/trunk@9 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-24 10:52:13 +00:00
yorhel
32a535d6d7
* When changing sort order to size, automatically sort in descending order
...
* Removed unused and hidden feature to sort on number of files
* When sorting on size, and multiple items have the same size, sort them on filename
* Updated changelog
git-svn-id: svn://blicky.net/ncdu/trunk@8 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-24 08:53:55 +00:00
yorhel
2202762f0a
* Changed default sort order to size, descending, and don't sort dirs before files
...
* Fixed bug concerning multiple exclude patterns
git-svn-id: svn://blicky.net/ncdu/trunk@7 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-24 08:25:44 +00:00
yorhel
87a7925b99
* Rewrote the file browser, help window, and delete windows
...
* Split browser.c into delete.c and help.c
* Added "reference to parent directory"-hack
* File browser doesn't use the ncurses menu lib anymore
* Fixed bug #1758403 : large directories work fine now
* Fixed bug with wide characters in the browser
* Performance improvements when browsing large directories
* Required (instead of recommended) gettimeofday()
git-svn-id: svn://blicky.net/ncdu/trunk@6 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-24 07:58:22 +00:00
yorhel
5390111c4b
SVN cleanup: removed automatically generated build files, added autogen.sh to create these, and added svn:ignore to ignore common files
...
git-svn-id: svn://blicky.net/ncdu/trunk@5 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-22 16:27:04 +00:00
yorhel
6cff03b95d
Small bugs fixed related to the exclude feature
...
git-svn-id: svn://blicky.net/ncdu/trunk@4 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-22 13:43:24 +00:00
yorhel
3fddf6f09b
Added exclude option and increased version numer
...
git-svn-id: svn://blicky.net/ncdu/trunk@3 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-21 13:55:51 +00:00
yorhel
4de245f29b
Small bugfixes + cygwin patch
...
git-svn-id: svn://blicky.net/ncdu/trunk@2 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-20 11:29:50 +00:00
yorhel
6e3bbe69ee
Initial import (ncdu-1.1)
...
git-svn-id: svn://blicky.net/ncdu/trunk@1 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-20 11:15:46 +00:00