Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: file open problem with scheduled jobs

by shemp (Deacon)
on Jul 22, 2004 at 16:05 UTC ( [id://376634]=note: print w/replies, xml ) Need Help??


in reply to Re: file open problem with scheduled jobs
in thread file open problem with scheduled jobs

$filename1 is a unix filesystem path, which is the way that the file *really* is addressed.

$filename2 is a web address. The web server translates the web address into a unix filesystem filename, based on how you have the web server configured. http://my_site/ is the web address of the web server, the next part, /cgi-bin/, is probably your cgi root, which is set up in your web server configuration, and translates to some absolute base path, in your case it appears to be /var/apache/cgi-bin/. The rest, user/test.txt refers to a specific file on that server.

So the web server filename translation changes your address to /var/apache/cgi-bin/user/test.txt, which is exactly what $filename1 is.

So, after all that, the web server automatically does that translation, but perl assumes that you are giving a relative or absolute pathname that is of the form your operating system normally deals with, i.e. it doesnt do the translation that the web server does. If you're much into unix, think about why a command like rm $filename2 wont work right. perl assumes filenames just like the unix shell does.

The reasons for the web address translation are many, it allows virtual hosting, and it also keeps me from doing something like http://your_server/etc/passwd - which you probably dont want me doing.

You should probably read up on apache & web server conifguration in general.

  • Comment on Re^2: file open problem with scheduled jobs

Replies are listed 'Best First'.
Re: file open problem with scheduled jobs
by nmete (Novice) on Jul 22, 2004 at 19:54 UTC
    OK... what I missed out was, once I scheduled the job then it is not running on any http server.. so there was no web server to do the address translation that I expected...
    thanks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 02:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found