Quick question: recursive touch?

Malcolm Tredinnick malcolmt at smart.net.au
Tue Oct 5 20:53:48 EDT 1999


On Tue, Oct 05, 1999 at 09:21:28PM +0000, Blake Winton wrote:
> On Tue, 05 Oct 1999 20:51:25 GMT, Preston Landers wrote:
[ ...random deletions... ]

> >> 'open(file,"w")' will cause the file to become zero bytes long.
> >
> >Isn't that what touch does?
> 
> Nope.  touch only changes the time if the file already exists...

I guess it depends on the version of touch you are using. By default,
the GNU version *does* create a file of zero length if it doesn't
previously exist. This is a documented faeture. If you don't want this
to happen, you must pass the -c or --no-create option.

Cheers,
Malcolm Tredinnick





More information about the Python-list mailing list