Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: root unable to unlink files

by ig (Vicar)
on Sep 01, 2009 at 15:13 UTC ( #792683=note: print w/replies, xml ) Need Help??

in reply to root unable to unlink files

A program running as www-data can't easily create a file in the outbound spool owned by root.dialer. There may be some error in your assumption about the web server process or which process is creating the file in the outbound spool.

When unlink and rename fail, they return error indications. What is the return value and what is $! set to immediately after the calls to these functions? What are the values of "$queue/$call_file" when these functions are called?

I usually call these functions as follows.

unlink($path) or die "unlink: $path: $!"; rename($oldpath,$newpath) or die "rename($oldpath,$newpath): $!";

Can you do similarly? Are errors reported?

update: What makes you think that unlink and rename were executed?

Maybe you can call them as follows:

unlink($path) or die "unlink($path): $!"; warn "unlike($path) succeeded"; rename($oldpath,$newpath) or die "rename($oldpath,$newpath): $!"; warn "rename($oldpath,$newpath) succeeded";

Then check your error output: you should have either an error indication that specifies the cause of the error or a positive indication that the function call was successful.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://792683]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2023-06-06 12:16 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (26 votes). Check out past polls.