By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,374 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,374 IT Pros & Developers. It's quick & easy.

Deleting a file

P: 67
Can't seem to get this to delete the file, ive tried setting the permissions but it still won't delete.

Expand|Select|Wrap|Line Numbers
  1. my $fileName = 'c:\inetpub\wwwroot\guessingGame\guessingGame.csv'; 
  2. unlink($fileName);
Mar 13 '09 #1
Share this Question
Share on Google+
1 Reply


KevinADC
Expert 2.5K+
P: 4,059
@chanshaw
Please reply to the threads you start.

Try this, see what $! returns:

Expand|Select|Wrap|Line Numbers
  1. my $fileName = 'c:\inetpub\wwwroot\guessingGame\guessingGame.csv'; 
  2. unlink($fileName) or die "Can't delete file $filename : $!";
There is nothing patently wrong with your usage so either its a wrong path or the file is not closed or some other issue.
Mar 13 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.