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

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.


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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2021-05-12 06:07 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (124 votes). Check out past polls.