[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dos filename portability in pathchk
From: |
James Youngman |
Subject: |
Re: dos filename portability in pathchk |
Date: |
Thu, 14 Apr 2005 18:00:24 +0100 |
User-agent: |
Mutt/1.3.28i |
On Wed, Apr 13, 2005 at 06:16:59PM +0000, Eric Blake wrote:
> Because of command line length limitations, `find . -print | xargs
> pathchk -c' might not find all case conflicts, so it would be nice
> if pathchk could operate as a filter when no filenames are supplied,
> allowing `find . -print | pathchk -c'. Which also implies that
> `find . -print0 | pathchk -0 -c' should work...
I suppose a reasonable substitute for detecting files with the same
(case-folded) name might be somethign along these lines:-
find "$@" \( -name "* *" -o -name "*
*" \) -printf "[%p] contains a newline or a space and so is not legal in DOS\n"
>&2
find "$@" \! -name "* *" \! -name "*
*" -print | sort -fu | uniq -in | awk '$1 > 1 {printf("%d files have a name
like %s\n", $1, $2);}' >&2
I agree that it would be interesting for pathchk to be able to do this
sort of thing. Perhaps for case-folded filenames, the check would
need to be made once with LC_COLLATE=POSIX and once with the local
collation order (because the files may be named in a non-English
alphabet).
James.