Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Illegal seek error on perl app.

Status
Not open for further replies.

Haunter

Programmer
Jan 2, 2001
379
US
I am receiveing this error when trying to delete a file off the server from a web page. I have no idea what it means and am at a loss about how to correct the problem in my web application. The file does get deleted but the error does persists despite the execution of the delete of the file. Any suggestion would be appreciated.

I am using the unlink command in perl
if (-e $file_to_delete) { unlink ($file_to_delete) || &cgiError ("Error Deleting $file_to_delete:", "$!");

The error in the $! variable is "Illegal seek". Any help would be appreciated.
 
I think you need the following:

if (-e $file_to_delete) {
&cgiError("Error Deleting $file_to_delete:", "$!")
unless(unlink($file_to_delete));
}

As the unlink function returns the number of files deleted, you were always saying there was an error condition, even though there was no error.

HTH,
Barbie.
Leader of Birmingham Perl Mongers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top