Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
47e969cd
Commit
47e969cd
authored
7 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Add -e flag to enable extended information mode
And document the --color flag that I forgot.
parent
77aca35f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/ncdu.pod
+13
-0
13 additions, 0 deletions
doc/ncdu.pod
src/dir_mem.c
+3
-3
3 additions, 3 deletions
src/dir_mem.c
src/global.h
+2
-0
2 additions, 0 deletions
src/global.h
src/main.c
+5
-0
5 additions, 0 deletions
src/main.c
with
23 additions
and
3 deletions
doc/ncdu.pod
+
13
−
0
View file @
47e969cd
...
@@ -54,6 +54,19 @@ directory with many files. 10.000 files will get you an export in the order of
...
@@ -54,6 +54,19 @@ directory with many files. 10.000 files will get you an export in the order of
gzip. This scales linearly, so be prepared to handle a few tens of megabytes
gzip. This scales linearly, so be prepared to handle a few tens of megabytes
when dealing with millions of files.
when dealing with millions of files.
=item -e
Enable extended information mode. This will, in addition to the usual file
information, also read the ownership, permissions and last modification time
for each file. This will result in higher memory usage (by roughly ~30%) and in
a larger output file when exporting.
When using the file export/import function, this flag will need to be added
both when exporting (to make sure the information is added to the export), and
when importing (to read this extra information in memory). This flag has no
effect when importing a file that has been exported without the extended
information.
=back
=back
=head2 Interface options
=head2 Interface options
...
...
This diff is collapsed.
Click to expand it.
src/dir_mem.c
+
3
−
3
View file @
47e969cd
...
@@ -123,11 +123,11 @@ static int item(struct dir *dir, const char *name, struct dir_ext *ext) {
...
@@ -123,11 +123,11 @@ static int item(struct dir *dir, const char *name, struct dir_ext *ext) {
if
(
!
root
&&
orig
)
if
(
!
root
&&
orig
)
name
=
orig
->
name
;
name
=
orig
->
name
;
/* TODO: Don't allocate ext if -e flag is not given */
int
extended
=
extended_info
&&
(
dir
->
flags
&
FF_EXT
);
item
=
malloc
(
dir
->
flags
&
FF_EXT
?
dir_ext_memsize
(
name
)
:
dir_memsize
(
name
));
item
=
malloc
(
extended
?
dir_ext_memsize
(
name
)
:
dir_memsize
(
name
));
memcpy
(
item
,
dir
,
offsetof
(
struct
dir
,
name
));
memcpy
(
item
,
dir
,
offsetof
(
struct
dir
,
name
));
strcpy
(
item
->
name
,
name
);
strcpy
(
item
->
name
,
name
);
if
(
dir
->
flags
&
FF_EXT
)
if
(
extended
)
memcpy
(
dir_ext_ptr
(
item
),
ext
,
sizeof
(
struct
dir_ext
));
memcpy
(
dir_ext_ptr
(
item
),
ext
,
sizeof
(
struct
dir_ext
));
item_add
(
item
);
item_add
(
item
);
...
...
This diff is collapsed.
Click to expand it.
src/global.h
+
2
−
0
View file @
47e969cd
...
@@ -101,6 +101,8 @@ extern long update_delay;
...
@@ -101,6 +101,8 @@ extern long update_delay;
extern
int
cachedir_tags
;
extern
int
cachedir_tags
;
/* flag if we should ask for confirmation when quitting */
/* flag if we should ask for confirmation when quitting */
extern
int
confirm_quit
;
extern
int
confirm_quit
;
/* flag whether we want to enable use of struct dir_ext */
extern
int
extended_info
;
/* handle input from keyboard and update display */
/* handle input from keyboard and update display */
int
input_handle
(
int
);
int
input_handle
(
int
);
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
5
−
0
View file @
47e969cd
...
@@ -40,6 +40,7 @@ int pstate;
...
@@ -40,6 +40,7 @@ int pstate;
int
read_only
=
0
;
int
read_only
=
0
;
long
update_delay
=
100
;
long
update_delay
=
100
;
int
cachedir_tags
=
0
;
int
cachedir_tags
=
0
;
int
extended_info
=
0
;
static
int
min_rows
=
17
,
min_cols
=
60
;
static
int
min_rows
=
17
,
min_cols
=
60
;
static
int
ncurses_init
=
0
;
static
int
ncurses_init
=
0
;
...
@@ -120,6 +121,7 @@ static void argv_parse(int argc, char **argv) {
...
@@ -120,6 +121,7 @@ static void argv_parse(int argc, char **argv) {
{
'q'
,
0
,
"-q"
},
{
'q'
,
0
,
"-q"
},
{
'v'
,
0
,
"-v"
},
{
'v'
,
0
,
"-v"
},
{
'x'
,
0
,
"-x"
},
{
'x'
,
0
,
"-x"
},
{
'e'
,
0
,
"-e"
},
{
'r'
,
0
,
"-r"
},
{
'r'
,
0
,
"-r"
},
{
'o'
,
1
,
"-o"
},
{
'o'
,
1
,
"-o"
},
{
'f'
,
1
,
"-f"
},
{
'f'
,
1
,
"-f"
},
...
@@ -148,6 +150,7 @@ static void argv_parse(int argc, char **argv) {
...
@@ -148,6 +150,7 @@ static void argv_parse(int argc, char **argv) {
printf
(
" -q Quiet mode, refresh interval 2 seconds
\n
"
);
printf
(
" -q Quiet mode, refresh interval 2 seconds
\n
"
);
printf
(
" -v Print version
\n
"
);
printf
(
" -v Print version
\n
"
);
printf
(
" -x Same filesystem
\n
"
);
printf
(
" -x Same filesystem
\n
"
);
printf
(
" -e Enable extended information
\n
"
);
printf
(
" -r Read only
\n
"
);
printf
(
" -r Read only
\n
"
);
printf
(
" -o FILE Export scanned directory to FILE
\n
"
);
printf
(
" -o FILE Export scanned directory to FILE
\n
"
);
printf
(
" -f FILE Import scanned directory from FILE
\n
"
);
printf
(
" -f FILE Import scanned directory from FILE
\n
"
);
...
@@ -157,12 +160,14 @@ static void argv_parse(int argc, char **argv) {
...
@@ -157,12 +160,14 @@ static void argv_parse(int argc, char **argv) {
printf
(
" -X, --exclude-from FILE Exclude files that match any pattern in FILE
\n
"
);
printf
(
" -X, --exclude-from FILE Exclude files that match any pattern in FILE
\n
"
);
printf
(
" --exclude-caches Exclude directories containing CACHEDIR.TAG
\n
"
);
printf
(
" --exclude-caches Exclude directories containing CACHEDIR.TAG
\n
"
);
printf
(
" --confirm-quit Confirm quitting ncdu
\n
"
);
printf
(
" --confirm-quit Confirm quitting ncdu
\n
"
);
printf
(
" --color SCHEME Set color scheme
\n
"
);
exit
(
0
);
exit
(
0
);
case
'q'
:
update_delay
=
2000
;
break
;
case
'q'
:
update_delay
=
2000
;
break
;
case
'v'
:
case
'v'
:
printf
(
"ncdu %s
\n
"
,
PACKAGE_VERSION
);
printf
(
"ncdu %s
\n
"
,
PACKAGE_VERSION
);
exit
(
0
);
exit
(
0
);
case
'x'
:
dir_scan_smfs
=
1
;
break
;
case
'x'
:
dir_scan_smfs
=
1
;
break
;
case
'e'
:
extended_info
=
1
;
break
;
case
'r'
:
read_only
++
;
break
;
case
'r'
:
read_only
++
;
break
;
case
's'
:
si
=
1
;
break
;
case
's'
:
si
=
1
;
break
;
case
'o'
:
export
=
val
;
break
;
case
'o'
:
export
=
val
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment