Re: new VFS directory listing parser



Hi Roland,

On Tue, 2005-09-27 at 01:27 +0200, Roland Illig wrote:
> The current directory listing parser (for ftpfs and extfs) has problems 
> with file names starting with white-space or a four-digit sequence.

The latter is caused by the fact that different types of time format are
accepted: "Mon DD YYYY", "Mon DD hh:mm", "Mon DD YYYY hh:mm" and "Mon DD
hh:mm YYYY". This makes it so the code doesn't know if it parsed the
full date after having parsed the first 3 fields.

How did you avoid this pitfall? There is nothing in the ls output that
makes it obvious whether we've reached the last part of the date.

If you've just dropped the assumption there are more than 3 fields and
only accept "Mon DD YYYY" and "Mon DD hh:mm" as valid formats the
existing code can quite easily be patched instead of doing a whole
rewrite. See utilvfs.h around line 635 ("This is a special case for
ctime"). Add a var got_time and stop parsing the date after either
got_time or got_year.

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]