["PATCH"] Re: Mailfs date problem

Leonard den Ottolander leonard at den.ottolander.nl
Thu May 25 22:02:31 UTC 2006


Hi,

On Fri, 2006-05-19 at 00:06 +0200, Leonard den Ottolander wrote:
> Pavel Tsekov drew my attention to the fact that the fact that we now
> only parse dates with 3 elements (either year or time, not both) broke
> mailfs. I intend to fix this, but haven't had time to look into this
> thoroughly.
> 
> The representation for files younger and older than 6 months use either
> time or year in the third field. However, there's a bit of an issue as
> to what constitutes to 6 months that I need to investigate before I can
> commit a correct fix. GNU ls seems to change at 180 or 181 days in the
> past (not sure why this is inconsistent) but I'm unsure what mc assumes
> internally (this day 6 months ago?).

The function file_date parses dates older than 180 days or more than 1
hour in the future to be represented with a year instead of a time. The
mentioned POSIX cutoff of 6 months represents 181 or 182 days if
February is included and 184 days if February is not included.

Attached file is a replacement for mailfs. Please test. It parses the
dates back to 3 elements. Used ranges are estimates that are slightly
larger than the ranges used by file_date, but this avoids overly complex
equations and file_date parses them back to a "correct" representation
anyway.

Leonard.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mailfs
Type: application/x-perl
Size: 5179 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20060526/be71669f/attachment.bin>


More information about the mc-devel mailing list