Example:
if i have
unlink "file";
unlink "file.txt";
it will delete the file(s) like its suppose to.
However if i have another command along with unlink (example print)
print "hi";
unlink "file";
unlink "file.txt";
It won't delte the file(s)
When you reply can u please make it easy to understand.
perhaps that "unlink($file $)" actually failed because it looks like a list with a blank item in it?
in unlink's case, it returns the number of files deleted, so 0 means that no files were deleted. that "solution" you posted really looks weird, especially the unlink($file $)-part, which should result in a syntax error.
are you sure the files are not deleted when you just add the print-statement?
can you simplify it, put just the minimum into a script, no other stuff, try it and if it does not work, post that?
did you create those files yourself or did a script create them?
maybe the script you're running (is it a cgi-script?) is not allowed to delete those files.
put
print $> . "\n" . $< . "\n";
into the script to get the userids ($< = real user id, $> = effective user id) your script is run with. than you can figure out if that user is allowed to delete those files.
in unlink's case, it returns the number of files deleted, so 0 means that no files were deleted. that "solution" you posted really looks weird, especially the unlink($file $)-part, which should result in a syntax error.
Yes, in this case unlink is a list operator and the return value is the number of times the unlink function was successful, not simply 1 or 0 to indicate success or failure like other functions that don't expect a list.