Delete a file from a CGI

Steve Holden steve at
Fri Jun 1 13:12:13 CEST 2007

Matias Surdi wrote:
> HI!
> I want to delete a file from a CGI, but I always get a Permission denied
> error.
> I've tryed this after creating the file (from a normal script):
> os.chmod(".lock",stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG))
> os.chown(".lock",pwd.getpwnam("nobody")[2],pwd.getpwnam("nobody")[3])
> but the CGI still can't delete the file.
> I will appreciate very much your help.
> Thanks a lot.
How was the file created in the first place? If you don't have 
permissions to delete it you may well not have permissions to reown it 
or change its permissions either!

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd 
Skype: holdenweb
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
tagged items:
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

More information about the Python-list mailing list