bug-make
[Top][All Lists]
Advanced

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

Re: 'withfile' function implementation


From: Paul Smith
Subject: Re: 'withfile' function implementation
Date: Mon, 30 Jan 2012 18:19:56 -0500

On Mon, 2012-01-30 at 17:44 -0500, David Boyce wrote:
> Thanks, this will make a lot of people happy.
> 
> One nit: as mentioned earlier I think it would be good to document the
> relationship of $(file ...) with timestamps. Assuming nothing special
> is done (I haven't looked at the code) then writing a null string will
> not update the timestamp. I tried to make a case in favor of doing
> something special but either way it would be good to get the behavior
> on the record.

You're right that this should be documented, I'll add it to the manual.

As currently implemented, if the text argument is empty then the file
will be opened (either for truncate or append as specified), but it will
not be written to.

This means the following, at least on POSIX systems:
      * If the file doesn't exist it will be created and the modtime set
        appropriately (to "now", where "now" is defined by the
        filesystem server--note this might be different than "now" on
        the local system, for builds on shared partitions!)
      * If the file does exist and it's opened for truncate (">") then
        the filesystem will update the modtime on it (even if it's
        already empty), again set to "now" on the filesystem server.
      * If the file does exist and it's opened for append (">>") then
        the modtime on the file will NOT be updated.

Is there "something special" you would prefer beyond this?

Cheers!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]