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

C. Abney cabney at ucsd.edu
Fri Sep 24 12:56:01 CDT 2004

On Fri, 2004-09-24 at 09:34, Joel Fentin wrote:
> 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");

You are trying to get a (local) perl executable to do file manipulation
on a remote machine?  I think you /did/ say earlier you wanted to do
file manipulations on a remote machine.

In any case, if the web-server is set up correctly no one can do file
manipulations from a remote site through HTTP.

The best you can hope for is:

	1. Perlish:  write a script on the remote server that performs
	   the action, and call that script from your (local?) server

	2. NonPerlish: have your local server script use system commands
	   that employ rsh, ssh, 

> 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.

You aren't comparing absolute addressing to relative addressing.  One
solution has access to the OS system calls and is manipulating local
files.  The other solution is attempting to manipulate remote files, or
to perform file system manipulations via HTTP, but is actually trying to
use system calls on files that don't exist (a URI is a meaningless
string as far as those system calls are concerned), which isn't a part
of the standard (thank goodness!)

> > * 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.

You still can't do it using URIs in your system calls.

> =========================
> > * Do you have complete control over the machine(s) on
> > which the files are located,
> Nope!

Do you have control over the files on the machine, and are you able to
execute commands on them and can you create script-based web-pages on
the machine where the files are located?

Charles Abney
Polymorphism Research Laboratory, 0603
UCSD School of Medicine
9500 Gilman Dr.
La Jolla, CA 92093-0603
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.pm.org/pipermail/san-diego-pm/attachments/20040924/bae3f81b/attachment.bin

More information about the San-Diego-pm mailing list