Re[2]: [Tutor] write to a file in linux (again)!
python
python <python@inkedmn.net>
Wed, 21 Aug 2002 10:50:18 -0700
does the whole path exist already?
python will only create files for you, not directories (unless you use
os.mkdir() <-- i think that's what it's called).
so, the directory you're trying to create a file in must exist before
you run this...
brett
WIG> -----Original Message-----
WIG> From: alan.gauld@bt.com [mailto:alan.gauld@bt.com]
WIG> Sent: Wednesday, August 21, 2002 1:31 PM
WIG> To: Watt III, Glenn; tutor@python.org
WIG> Subject: RE: [Tutor] write to a file in linux (again)!
>>
>>This is a guess but...
>>
>>Is
>>
>>newdesign/papers/cgi
>>
>>supposed to be a relative path? Or should it really be:
>>
>>/newdesign/papers/cgi
>>
>>Just a thought.
>>
>>If the directory doesn't exist python won't
>>create it, it will only create the file itself.
>>If you want to create the path as well you'll
>>need to use something else, probably in the
>>os module...
>>
>>os.mkdirs() looks like the one you would need.
>>
>>HTH,
>>
>>Alan g.
WIG> well i appreciate the thought but the path is relative i tried the full
WIG> path and i got the same error
WIG> _______________________________________________
WIG> Tutor maillist - Tutor@python.org
WIG> http://mail.python.org/mailman/listinfo/tutor