[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-grep] rewriting the main loop
From: |
Claudio Fontana |
Subject: |
Re: [bug-grep] rewriting the main loop |
Date: |
Sun, 27 Feb 2005 18:43:44 +0100 (CET) |
I have one question regarding handling of directories.
Currently handling of directories is one of
READ_DIRECTORIES, RECURSE_DIRECTORIES and
SKIP_DIRECTORIES, the default being READ_DIRECTORIES.
Q: Would it make sense (and would it be ok with posix)
to make the standard behaviour SKIP_DIRECTORIES?
On READ_DIRECTORIES maybe we could try to really read
the directory (try read(2), on failure use readdir(3),
using dir entries as lines).
If this is not possible, then I would fail noisily
with READ_DIRECTORIES if read(2) fails on the
implementation at hand. So
> grep: dirname: Is a directory
and I would return 2. In fact dirname could not be
read, so the return value should be the same as
grep: nonexistant.txt: No such file or directory
in my opinion.
Claudio
___________________________________
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam,
Giochi, Rubrica
Scaricalo ora!
http://it.messenger.yahoo.it