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. |