in reply to unlink a server file

I understand the permissions issue and did some investigating through the command line.
Z:\HF ACCESS\IT\dev>perl testdel.pl \\fileprint-01\Company\HFACCE~1\IT\dev\test\test.txt couldn't delete \\fileprint-01\Company\HFACCE~1\IT\dev\test\test.txt: +Permission denied at testdel.pl line 12.
this is telling me permission problem. And when I dir that folder using the full path and try to del it gives me this
Z:\HF ACCESS\IT\dev>dir \\fileprint-01\Company\HFACCE~1\IT\dev\test\t +est.txt Volume in drive \\fileprint-01\Company is Data Volume Serial Number is C8C5-EF0A Directory of \\fileprint-01\Company\HFACCE~1\IT\dev\test 05/22/2009 10:21 AM 0 test.txt 1 File(s) 0 bytes 0 Dir(s) 196,346,269,696 bytes free Z:\HF ACCESS\IT\dev>del \\fileprint-01\Company\HFACCE~1\IT\dev\test\t +est.txt \\fileprint-01\Company\HFACCE~1\IT\dev\test\test.txt Access is denied.
This is where it gets tricky when I change the path to the long name and put quotes around the path it allows me to delete the file
Z:\HF ACCESS\IT\dev>del "\\fileprint-01\data\company\hf access\it\dev\ +test\test.txt"
I verified this with another file test.tst.txt after
Z:\HF ACCESS\IT\dev>dir \\fileprint-01\Company\HFACCE~1\IT\dev\test\t +est.tst.txt Volume in drive \\fileprint-01\Company is Data Volume Serial Number is C8C5-EF0A Directory of \\fileprint-01\Company\HFACCE~1\IT\dev\test 05/22/2009 11:27 AM 0 test.tst.txt 1 File(s) 0 bytes 0 Dir(s) 194,855,174,144 bytes free Z:\HF ACCESS\IT\dev>del \\fileprint-01\Company\HFACCE~1\IT\dev\test\ +test.tst.txt \\fileprint-01\Company\HFACCE~1\IT\dev\test\test.tst.txt Access is denied.
Now when I tried putting this into play with perl and unlink this is what I recieved.
Z:\HF ACCESS\IT\dev>perl testdel.pl "\\fileprint-01\Company\HF ACCESS\IT\dev\test\test.tst.txt" couldn't delete "\\fileprint-01\Company\HF ACCESS\IT\dev\test\test.tst +.txt": No such file or directory at testdel.pl line 12. Z:\HF ACCESS\IT\dev>dir "\\fileprint-01\Company\HF ACCESS\IT\dev\test\ +test.tst.txt" Volume in drive \\fileprint-01\Company is Data Volume Serial Number is C8C5-EF0A Directory of \\fileprint-01\Company\HF ACCESS\IT\dev\test 05/22/2009 11:27 AM 0 test.tst.txt 1 File(s) 0 bytes 0 Dir(s) 194,891,591,680 bytes free Z:\HF ACCESS\IT\dev>perl testdel.pl \\fileprint-01\Company\HF ACCESS\IT\dev\test\test.tst.txt couldn't delete \\fileprint-01\Company\HF ACCESS\IT\dev\test\test.tst. +txt: Permission denied at testdel.pl line 12.
In the script I inserted quotes around the file name for the first run and removed them for the second because that is what did it for del in the command prompt. What am i missing about unlink, why when I use quotes it tells me that it does not exist and when I don't it tells me permission denied.

Replies are listed 'Best First'.
Re^2: unlink a server file
by ig (Vicar) on May 23, 2009 at 05:31 UTC

    You say the following works:

    Z:\HF ACCESS\IT\dev>del "\\fileprint-01\data\company\hf access\it\dev\ +test\test.txt"

    But in all your examples that don't work the path is different - they don't have "data" after the server name. Could this be your problem?

      yes I could see how that would be confusing. data is the parent folder of company however both are shared on the server so both work just as well. Good thought though. I appreciate you looking at it.
Re^2: unlink a server file
by ikegami (Patriarch) on May 25, 2009 at 17:47 UTC

    Now when I tried putting this into play with perl and unlink this is what I recieved.

    On the command line, the quotes are used to tell the command line parser where the argument ends. They are not part of the file name and should not be passed to unlink.