[San-Diego-pm] Operating on files over there

Brick Robbins brickster3072 at gmail.com
Fri Sep 24 11:42:42 CDT 2004


Perl used the filesystem the path name, which is not the same as the
URL, since the path to the webserver root URL is not the same as the
filesystem root.

If the perl script is being run as a CGI, then this should work

rename("$ENV{'DOCUMENT_ROOT'}/cgi-bin/temp.txt","$ENV{'DOCUMENT_ROOT'}/cgi-bin/temp.old");

On Fri, 24 Sep 2004 09:34:47 -0700, Joel Fentin <joel at fentin.com> wrote:
> Emile Aben wrote:
> 
> >>From the description it is not clear to me what the
> > exact problem is.
> 
> Example of the problem:
> The first of these two lines does not work.
> The second does.
> rename("http://xxx.com/cgi-bin/temp.txt","http://xxx.com/cgi-bin/temp.old");
> 
> rename("./temp.txt","./temp.old");
> 
> The lesson seems to be that absolute addressing does not work. I am
> going to need absolute addressing to rename temp.txt at another URL -
> unless the other URL is on the very same server with xxx.com.
> =========================
> > * Are the files you want to process on the same
> > machine but in a different website-tree as your
> > CGI-script?
> 
> Possibly. If so, I can revert to relative addressing.
> =========================
> > * Do you have complete control over the machine(s) on
> > which the files are located,
> 
> Nope!
> 
>  or are we talking about a
> > hosted setup?
> 
> Hosted!!
> 
> 
> 
> --
> Joel Fentin    tel: 760-749-8863    FAX: 760-749-8864
> Contact me:    http://fentin.com/me/ContactMe.html
> Biz:           http://fentin.com
> Personal:      http://fentin.com/me/
> _______________________________________________
> San-Diego-pm mailing list
> San-Diego-pm at mail.pm.org
> http://www.pm.org/mailman/listinfo/san-diego-pm
>


More information about the San-Diego-pm mailing list