Best way to 'touch' a file?

Steve Holden steve at holdenweb.com
Tue Aug 23 09:14:14 EDT 2005


Peter Hansen wrote:
> Fredrik Lundh wrote:
> 
>>Peter Hansen wrote:
>>
>>
>>>You've quoted selectively.  He also said "Unix-style 'touch'", from
>>>which one could quite legitimately infer
>>
>>nope.  read his post again.
> 
> 
> Sigh.  You're being tiring, Fredrik:
> 
You probably mean "tiresome". Bots can be like that sometimes. And not 
only bots

> '''I'm looking for an easy way to perform a UNIX-style "touch", to 
> update the modification time of a file without actually modifying it.'''
> 
> And if your point is that I spelled UNIX in mixed case, and change the 
> double quotation marks to single quotation marks, you really need to 
> take a break.
> 
> If your point is that this statement *clearly and unambiguously* rejects 
> the create-if-missing feature as undesirable, then I can say only that 
> you are simply wrong.
> 
I rather suspect his point is that the OP's problem description 
specifically implies the file's prior existence. As I believe Fredrik 
did, I read "update the modification time of a file" to mean that the 
file already has a modification time. This would make the import of the 
path module you mentioned a little over the top given there's already a 
function in os to handle the requirement.

Given that both solutions have been presented, as far as the rest of the 
list is concerned we are probably all three just being tiresome now. The 
OP can choose whichever best meets his real requirements, whether they 
were accurately stated or not.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC             http://www.holdenweb.com/




More information about the Python-list mailing list