Touching Files On Windows

Pete Shinners shredwheat at mediaone.net
Wed May 16 12:29:06 EDT 2001


"Ben" <b.e.n. at .r.e.h.a.m.e...c.o.m> wrote
> Is there a way to touch files under windows using python? I can return
> the values as a tuple ... but it is immutable
>
> Any suggestions greatly appreciated.

hey ben, i can't say i quite understand you question. you've
really lost me with the returning a tuple? anyways, from what
i know, to touch a file means to update a files timestamp if
it exists, or just create a 0-byte file if it doesn't exist.

def touch(filename):
    open(filename, 'a')

that should be all you need. if you are asking for something
esle, i'm afraid i don't quite understand that that is.






More information about the Python-list mailing list