[Tutor] write to a file in linux (again)!

Jeff Shannon jeff@ccvcorp.com
Wed, 21 Aug 2002 11:08:10 -0700


"Watt III, Glenn" wrote:

> sorry i was careless with my last message i got an error but it wasnt
> the same now i lack the permissions to run the script which i can change
> in the linux shell but i am researching how to do throught python i
> thinks its
> >>> import os
> >>> system("chmod +x filename")

That should actually be  'os.system(" ...")'


> then open write and close but the problem is i cant change the write
> permissions before a file exists and i cant write a new file without
> having permissions i never had this problem before i was always aloud to
> write files or the files i couldnt write to already existed

What you need, then, is to change permissions on the *directory* that the
files are going into.

Jeff Shannon
Technician/Programmer
Credit International