diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-16 12:36:52 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-16 12:36:52 +0000 |
commit | d82db8e9a618ddd9a11cc57aff37f687abb0effb (patch) | |
tree | bd072e7344a3c3f0eff553d41c0f154c4470736e /findutils | |
parent | 91e49fbc7b55e8be78ac3ff943e9b7d4494dfe59 (diff) | |
download | busybox-w32-d82db8e9a618ddd9a11cc57aff37f687abb0effb.tar.gz busybox-w32-d82db8e9a618ddd9a11cc57aff37f687abb0effb.tar.bz2 busybox-w32-d82db8e9a618ddd9a11cc57aff37f687abb0effb.zip |
win32: make stat(2) fetch additional metadata
Modify the WIN32 implementation of stat(2) to fetch inode number,
device id and number of hardlinks. This requires opening a handle
to the target file so it will be slower.
A number of features can be enabled or start to work:
- tar can detect if an archive is being stored in itself;
- find can support the -inum and -links options;
- ls can display inode numbers;
- diff can detect attempts to compare a file with itself;
- du has better support for hardlinked files;
- cp can detect attempts to copy a file over itself.
Diffstat (limited to 'findutils')
-rw-r--r-- | findutils/find.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/findutils/find.c b/findutils/find.c index 06ad1b39c..0381f0685 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -121,7 +121,7 @@ | |||
121 | //config:config FEATURE_FIND_INUM | 121 | //config:config FEATURE_FIND_INUM |
122 | //config: bool "Enable -inum: inode number matching" | 122 | //config: bool "Enable -inum: inode number matching" |
123 | //config: default y | 123 | //config: default y |
124 | //config: depends on FIND | 124 | //config: depends on FIND && (PLATFORM_POSIX || FEATURE_EXTRA_FILE_DATA) |
125 | //config: | 125 | //config: |
126 | //config:config FEATURE_FIND_EXEC | 126 | //config:config FEATURE_FIND_EXEC |
127 | //config: bool "Enable -exec: execute commands" | 127 | //config: bool "Enable -exec: execute commands" |
@@ -227,7 +227,7 @@ | |||
227 | //config:config FEATURE_FIND_LINKS | 227 | //config:config FEATURE_FIND_LINKS |
228 | //config: bool "Enable -links: link count matching" | 228 | //config: bool "Enable -links: link count matching" |
229 | //config: default y | 229 | //config: default y |
230 | //config: depends on FIND | 230 | //config: depends on FIND && (PLATFORM_POSIX || FEATURE_EXTRA_FILE_DATA) |
231 | //config: help | 231 | //config: help |
232 | //config: Support the 'find -links' option for matching number of links. | 232 | //config: Support the 'find -links' option for matching number of links. |
233 | 233 | ||
@@ -1361,7 +1361,11 @@ static action*** parse_params(char **argv) | |||
1361 | action_inum *ap; | 1361 | action_inum *ap; |
1362 | dbg("%d", __LINE__); | 1362 | dbg("%d", __LINE__); |
1363 | ap = ALLOC_ACTION(inum); | 1363 | ap = ALLOC_ACTION(inum); |
1364 | # if !ENABLE_FEATURE_EXTRA_FILE_DATA | ||
1364 | ap->inode_num = xatoul(arg1); | 1365 | ap->inode_num = xatoul(arg1); |
1366 | # else | ||
1367 | ap->inode_num = xatoull(arg1); | ||
1368 | # endif | ||
1365 | } | 1369 | } |
1366 | #endif | 1370 | #endif |
1367 | #if ENABLE_FEATURE_FIND_USER | 1371 | #if ENABLE_FEATURE_FIND_USER |