[Tutor] How to create memory backed file?

2009-12-27 Thread Modulok
List, How do I create a file which exists only in memory? (Think diskless.) I need to create an in-memory file. I need to pass this file, as a regular file object, to a subprocess. Unfortunately, the 'mmap' module's file-like object doesn't appear to work quite like a regular file would. (I simpl

Re: [Tutor] How to create memory backed file?

2009-12-27 Thread Alan Gauld
"Modulok" wrote How do I create a file which exists only in memory? (Think diskless.) The nearest I can think of is probably StringIO Take a look at the docs for that and see if it works for you... Alan G. ___ Tutor maillist - Tutor@python.org

Re: [Tutor] How to create memory backed file?

2009-12-27 Thread Emile van Sebille
On 12/27/2009 12:03 PM Alan Gauld said... "Modulok" wrote How do I create a file which exists only in memory? (Think diskless.) The nearest I can think of is probably StringIO Take a look at the docs for that and see if it works for you... There's also http://docs.python.org/library/mma

Re: [Tutor] How to create memory backed file?

2009-12-27 Thread Kent Johnson
On Sun, Dec 27, 2009 at 3:36 AM, Modulok wrote: > List, > > How do I create a file which exists only in memory? (Think diskless.) > > I need to create an in-memory file. I need to pass this file, as a > regular file object, to a subprocess. Unfortunately, the 'mmap' > module's file-like object doe

Re: [Tutor] How to create memory backed file?

2009-12-27 Thread Modulok
Kent, Thanks! I think that'll do it. I don't know what this list would do without you! -Modulok- On 12/27/09, Kent Johnson wrote: > On Sun, Dec 27, 2009 at 3:36 AM, Modulok wrote: >> List, >> >> How do I create a file which exists only in memory? (Think diskless.) >> >> I need to create an in-