FTP with File::Find-like Capabilities: Does It Exist?

From: Jim Keenan (jkeen_via_google_at_yahoo.com)
Date: 04/26/04

  • Next message: Chirath Fernando: "ActivePerl & Apache"
    Date: 25 Apr 2004 18:48:34 -0700
    
    

    Seeking to practice the Perl virtue of laziness, I pose the following
    problem and question:

    My former ISP allocated me personal web space wherein every time I
    created a new directory with an FTP program, the server automatically
    created an index.html page for that directory. This page refreshed
    the links it indexed every time I created/deleted a file from a
    particular directory. The page was basic HTML -- no style***, no
    nuttin -- but it Just Worked.

    My new ISP does *not* automatically generate an index.html page when I
    upload/delete/rename files via FTP. As a result, I cannot easily
    browse through the directories in my web space; every link has to be
    manually typed.

    I would like to write a Perl script which provides File::Find-like
    capabilities for traversing directory trees and modifying files found
    therein with the power of FTP. Specifically, I would like the script
    to:

    1. Establish a connection with the FTP part of my ISP's service via
    Net::FTP (with which I am somewhat familiar).
    2. Traverse the directory structure of my FTP site much as File::Find
    would, with the objective of getting a complete picture of the
    directory tree.
    3. On the fly, create index.html pages for each directory with links
    to the parent directory (if public) and all files and subdirectories
    found therein.
    4. Upload the new index.html pages to the appropriate directories via
    Net::FTP, then log off.

    I would be surprised if I were the first person to have/want to do
    this. I looked at the listings under FTP on search.cpan.org, but none
    seemed to leap out and say, "I'm the one you want, baby."

    Suggestions for avoidance of reinvention of wheels? Thanks in
    advance.

    jimk


  • Next message: Chirath Fernando: "ActivePerl & Apache"
  • Quantcast