strikr has asked for the wisdom of the Perl Monks concerning the following question:

I'm using the unlink command to delete a file off an NT server, but everytime it runs it changes the permissions of the file so that it doesn't delete and the admin can't even delete it.

Is there a different way to use unlink on an NT server then a UNIX server?

Replies are listed 'Best First'.
Re: Unlink on NT
by jkahn (Friar) on Oct 17, 2002 at 20:28 UTC
    works for me.
    D:\TEMP>touch temp.file D:\TEMP>dir temp* Volume in drive D is APPS&DATA Volume Serial Number is 70E2-28A6 Directory of D:\TEMP 10/17/02 01:27p 0 temp.file 1 File(s) 0 bytes 425,926,656 bytes free D:\TEMP>perl -e "unlink('temp.file') or warn" D:\TEMP>dir temp* Volume in drive D is APPS&DATA Volume Serial Number is 70E2-28A6 Directory of D:\TEMP File Not Found
Re: Unlink on NT
by strikr (Initiate) on Oct 17, 2002 at 20:56 UTC
    I am using it in a cgi program. Does that have any implecations?

      CGI scripts under IIS run as the internet guest user (typically IUSR_MACHINE_NAME). If that is the user that created the file then there should be no problem.

      Bear in mind also, that the user will need write/modify access to the directory inorder to create or delete files in it.

        Can I set a global permission so that anyone with access to the script can delete the file?