Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: in memory files in 5.6.1

by liz (Monsignor)
on Oct 25, 2003 at 19:07 UTC ( #302094=note: print w/replies, xml ) Need Help??


in reply to in memory files in 5.6.1

Maybe IO::stringy is what you're looking for?

I'm not sure what you mean with RAM based dirs, but it should be possible to override mkdir(), chdir() and rmdir(). I don't know of any module that does what you appear to want.

Liz

Replies are listed 'Best First'.
Re: Re: in memory files in 5.6.1
by pg (Canon) on Oct 25, 2003 at 19:25 UTC

    If you are on windows, just do something like:

    subst p: \perl\bin

    Then your perl bin directory becomes your p: driver. Perl will pick it just as a physical driver.

    As for in memory file, unfortunately it is not in 5.6.1. Check perldelta of 5.8.0, under Core Enhancement/Perl IO is now the default.

Re: Re: in memory files in 5.6.1
by mandog (Curate) on Oct 25, 2003 at 20:07 UTC

    Thanks Liz

    update: Thanks hanenkamp

    IO::stringy looks useful, but as far as I can tell an stringy object can't be treated exactly like a file handle.

    For example I have to invoke the print method of the object instead of printing to a file handle

      Not true, this should work:

      use IO::Scalar; my $fh = IO::Scalar->new; print $fh "foo\n"; # Rather than $fh->print ... # or, if you prefer select $fh; print "bar\n";

      This works through the magic of a tied file handle. See perltie for details on tying a file handle.

        Hi hanenkamp,
        please do you have an idea to how handle these kind of "InMemoryfile" to put this on a local drive or to a webserver via HTTP::DAV of (S)FTP ?
        The transfer programs allways want to have a filename instead a filehandle.

        Regards
        WolliK

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://302094]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2019-08-18 04:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (134 votes). Check out past polls.

    Notices?