mpifileutils icon indicating copy to clipboard operation
mpifileutils copied to clipboard

dfind missing error message

Open ofaaland opened this issue 5 years ago • 4 comments

The following command produces a usage message, but no indication of which argument(s) I provided are/is invalid. Also, the exit status is 0.

bash-4.2$ which dfind
/usr/tce/packages/mpifileutils/mpifileutils-0.10/bin/dfind

bash-4.2$ dfind --input /p/lustre3/faaland1/vast.dwalk.mpfu /p/vast1/faaland1/  --name '*test*'            

Usage: dfind [options] <path> EXPRESSIONS...

Options:
  -i, --input <file>                      - read list from file
  -o, --output <file>                     - write processed list to file
  -v, --verbose                           - verbose output
  -q, --quiet                             - quiet output
  -h, --help                              - print usage

Tests:
  --amin N       - last accessed N minutes ago
  --anewer FILE  - last accessed more recently than FILE modified
  --atime N      - last accessed N days ago
  --cmin N       - status last changed N minutes ago
  --cnewer FILE  - status last changed more recently than FILE modified
  --ctime N      - status last changed N days ago
  --mmin N       - data last modified N minutes ago
  --newer FILE   - modified more recently than FILE
  --mtime N      - data last modified N days ago

  --gid N        - numeric group ID is N
  --group NAME   - belongs to group NAME
  --uid N        - numeric user ID is N
  --user NAME    - owned by user NAME

  --name PATTERN - base name matches shell pattern PATTERN
  --path PATTERN - full path matches shell pattern PATTERN
  --regex REGEX  - full path matches POSIX regex REGEX

  --size N       - size is N bytes.  Supports attached units like KB, MB, GB
  --type C       - of type C: d=dir, f=file, l=symlink

  Tests with N can use -N (less than N), N (exactly N), +N (more than N)

Actions:
  --print        - print item name to stdout
  --exec CMD ;   - execute CMD on item

ofaaland avatar Apr 06 '20 19:04 ofaaland

The input file I gave exists, is readable by me, and was created by dwalk from same build of mpifileutils:

bash-4.2$ head  /p/lustre3/faaland1/vast.dwalk.mpfu
/p/vast1/faaland1|D
/p/vast1/faaland1/#test-dir.0|D
/p/vast1/faaland1/old|D
/p/vast1/faaland1/old/#test-dir.0|D
/p/vast1/faaland1/old/make-busy|D
/p/vast1/faaland1/old/make-busy/#test-dir.0|D
/p/vast1/faaland1/old/make-busy/mdt0|D
/p/vast1/faaland1/old/make-busy/mdt0/mdtest.0UUReB|D
/p/vast1/faaland1/old/make-busy/mdt0/mdtest.18fq4S|D
/p/vast1/faaland1/old/make-busy/mdt0/mdtest.742LY7|D

ofaaland avatar Apr 06 '20 19:04 ofaaland

Thanks for the report, @ofaaland . Without testing this myself yet, I think it is likely tripping over the fact that both an input file --input /p/lustre3/faaland1/vast.dwalk.mpfu and an input path are /p/vast1/faaland1/ being specified. Most tools do not support both of those at the same time.

Can you test whether it works if you drop one of those?

Obviously, if that's the problem, printing a better error message about that would be helpful in the short term. In the long-term, some tools could probably support both at the same time.

adammoody avatar Apr 06 '20 20:04 adammoody

@adammoody you're right, that was the problem.

Note that the Usage message grammar says that input path is required:

Usage: dfind [options] <path> EXPRESSIONS...

Since the usage message needs to change anyway, note also that the usage message doesn't indicate where "Actions" are allowed.

ofaaland avatar Apr 06 '20 20:04 ofaaland

I can come up with a patch and push a PR for these.

ofaaland avatar Apr 06 '20 20:04 ofaaland