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.

In reply to Re: unlink a server file by jonschin
in thread unlink a server file by jonschin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.