Hi,
This probably is going to sound like a stupid question but here goes.
When I open a filehandle or new IO::File object, does it create a physical file on the hard drive or a virtual file in memory.
I'm using Archive::Zip and was considering some way of creating the zip archive in memory and printing to STDOUT, I've tried a few of the 'filehandle' examples in Archive::Zip , but I get an error about 'bad file descriptor' if I just create a new IO::File object without a filename.
Is it possible to create a filehandle that is in memory not on the hard drive and then print to it? So I can then output the file in memory to STDOUT (the browser).
I've currently got it working by creating a temp zip file on the fly, then opening it and printing to STDOUT and then deleting the temp file when finished.
What is the best way and is trying to store a 100MB zip file in memory to print to STDOUT going to hog the webserver resources once a few people start downloading?
Is creating temporary zip files the 'best practice' method of doing this?
Thanks,
1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
MIME::Lite TLS Email Encryption - Perl v0.02 beta
This probably is going to sound like a stupid question but here goes.
When I open a filehandle or new IO::File object, does it create a physical file on the hard drive or a virtual file in memory.
I'm using Archive::Zip and was considering some way of creating the zip archive in memory and printing to STDOUT, I've tried a few of the 'filehandle' examples in Archive::Zip , but I get an error about 'bad file descriptor' if I just create a new IO::File object without a filename.
Is it possible to create a filehandle that is in memory not on the hard drive and then print to it? So I can then output the file in memory to STDOUT (the browser).
I've currently got it working by creating a temp zip file on the fly, then opening it and printing to STDOUT and then deleting the temp file when finished.
What is the best way and is trying to store a 100MB zip file in memory to print to STDOUT going to hog the webserver resources once a few people start downloading?
Is creating temporary zip files the 'best practice' method of doing this?
Thanks,
1DMF.
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
MIME::Lite TLS Email Encryption - Perl v0.02 beta