Midnite has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have, what is to me, a strange problem. I have a script that creates a file, and due to permissions I don't have, I had to create a folder outside of of the norm so I could write it to the server.

Now that I have the file written, I can access it via the web, because of it being out side of the norm. For it to be accessed, I need to copy, or move, the file to a directory that I canaccess via the web. It is on the same server, but, here is my question:

I have the absolute address for the one, but not the other. Do I need it for both? Or, can I give the web address? I know I should use File::Copy, but not entirely clear with the methodology.

Joseph A. Ruffino
Automated Systems Assistant
Gail Borden Public Library District
270 N. Grove Ave
Elgin, Il, 60120
847-742-2411 x367
jruffino@nsls.info

Replies are listed 'Best First'.
Re: File Copy
by NetWallah (Canon) on May 27, 2004 at 02:43 UTC
    If I understand your question correctly, you have created a file using an absolute path in the file system. You would like to access the file via a web URL.

    The answer will depend on what web server you use, the OS, and what rights you have.

    From the information you have provided, it appears that you do not have the required WRITE access to a directory that is accessible via the web. If you did, the simplest solution would be to create your file there. Since you dont, you cannot copy the file there, and you are SOL, unless you can get such a right.

    Offense, like beauty, is in the eye of the beholder, and a fantasy.
    By guaranteeing freedom of expression, the First Amendment also guarntees offense.
      Hi NetWallah,

      First, thanks for the reply, thinking about what you said, and it should have occured to me that I wouldn't be able to a file copy, since it is basically like a file create or write.

      So, I have another question, is it possible to invoke an ft session? Because i am allowed to ftp anything I want to any subdirectory of my choosing

      If I can't figure it out, I can just use a manual ftp to get it there, but if I can write it in Perl, I would love it!

      Joseph A. Ruffino
      Automated Systems Assistant
      Gail Borden Public Library District
      270 N. Grove Ave
      Elgin, Il, 60120
      847-742-2411 x5986
      jruffino@nsls.info
        Sure - ftp in perl is usually accomplished using the module Net::FTP.

        There is a simplified perl interface to FTP in the module IO::Ftp , which I have not personally tested.

        Offense, like beauty, is in the eye of the beholder, and a fantasy.
        By guaranteeing freedom of expression, the First Amendment also guarantees offense.

Re: File Copy
by meonkeys (Chaplain) on May 27, 2004 at 01:04 UTC

    Joseph,

    What is "the norm"? What does it mean when you create a folder "outside of the norm"?

    Would you provide code samples and URLs, please? If necessary, construct a test application.

    ---
    "A Jedi uses the Force for knowledge and defense, never for attack."