Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Net::ChooseFName 0.01

    Download button

    No screenshots available
    Downloads: 343  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ilya Zakharevich | More programs
    Perl Artistic License / FREE
    June 12th, 2006, 17:59 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Net::ChooseFName description

    Net::ChooseFName is a Perl extension for choosing a name of a local mirror of a net (e.g., FTP or HTTP) resource.

    Net::ChooseFName is a Perl extension for choosing a name of a local mirror of a net (e.g., FTP or HTTP) resource.

    SYNOPSIS

    use Net::ChooseFName;
    $namer = Net::ChooseFName->new(max_length => 64); # Copies to CD ok

    $name = $namer->find_name_by_response($LWP_response);
    $name = $namer->find_name_by_response($LWP_response, $as_if_content_type);

    $name = $namer->find_name_by_url($url, $suggested_name,
    $content_type, $content_encoding);
    $name = $namer->find_name_by_url($url, $suggested_name, $content_type);
    $name = $namer->find_name_by_url($url, $suggested_name);
    $name = $namer->find_name_by_url($url);

    $namer_returns_undef = Net::ChooseFName->failer(); # Funny constructor

    This module helps to pick up a local file name for a remote resource (e.g., one downloaded from Internet). It turns out that this is a tricky business; keep in mind that most servers are misconfigured, most URLs are malformed, and most filesystems are limited w.r.t. possible filenames. As a result most downloaders fail to work in some situations since they choose names which are not supported on particular filesystems, or not useful for file:///-related work.

    Because of the many possible twists and ramifications, the design of this module is to be as much configurable as possible. One of ways of configurations is a rich system of options which influence different steps of the process. To cover cases when options are not flexible enough, the process is broken into many steps; each step is easily overridable by subclassing Net::ChooseFName.

    The defaults are chosen to be as safe as possible while not getting very much into the ways. For example, since % is a special character on DOSish shells, to simplify working from command line on such systems, we avoid this letter in generated file names. Similarly, since MacOS has problems with filenames with 8-bit characters, we avoid them too; since may Unix programs have problem with spaces in file names, we massage them into underscores; the length of the longest file path component is restricted to 255 chars.

    Note that in many situations it is advisable to make these restrictions yet stronger. For example, for copying to CD one should restrict names yet more (max_length => 64); for copying to MSDOS file systems enable option '8+3' => 1.
    [In the description of methods the $self argument is omitted.]

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Perl module | Perl library | choosing a name | Net::ChooseFName | Perl | module

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM