Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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


Comment on Re: in memory files in 5.6.1
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.

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 surveying the Monastery: (7)
As of 2014-08-30 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls