Re: Writing output files to memory



Pierre Asselin wrote:

(snip)

This is not a Fortran question but: probably yes, because your
operating system has a "tmpfs" filesystem. You can create something
that looks like a directory but is kept in memory (or swap, if it
gets too big). You need the root password for that.

Well, if the system already has a tmpfs file system then just use it.
It is sometimes used for /tmp, which is why it is named tmpfs.
That is especially useful for C compilers that write intermediate files to /tmp.


> If you run your Fortran program in this directory it will probably save its
files there with no change.  Of course the tmpfs is lost if you
shut down.

(snip)

If I do get Fortran to write to memory, I will then require a 3rd
party program (I have no access to this program's source code) to
locate the output file in memory so that it can read/write to it. How
do I know what memory address Fortran has written to?

In the most common use of internal WRITE, a scalar variable is used, and a single record (line) is written. You can also use an array of CHARACTER variables, in which case each record is written to an array element. One could, then, write an entire file to a CHARACTER array, and then do something with it. Though I agree with the other posts, that this doesn't seem likely to be the solution you want.

-- glen

.



Relevant Pages

  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: High Memory Consumption of Classes and Arrays
    ... Only the array itself has overhead. ... memory as a reference type. ... > least consume 40 bytes of memory. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Fast linked list
    ... > amounts of memory rather than huge chunks of it. ... random insertions into a vector/dynamic array are not as slow ... to cause a cache miss. ... some hard numbers on speed differences between lists and arrays. ...
    (microsoft.public.vc.mfc)
  • Re: Fast linked list
    ... > amounts of memory rather than huge chunks of it. ... random insertions into a vector/dynamic array are not as slow ... to cause a cache miss. ... some hard numbers on speed differences between lists and arrays. ...
    (microsoft.public.vc.language)
  • Re: [PATCH] Use MPOL_INTERLEAVE for tmpfs files
    ... which wants tmpfs to behave differently. ... all of the system memory. ... > As long as it defaults to off, I guess I don't really care. ... I've got a new patch including Andi's suggested sysctl ready to go. ...
    (Linux-Kernel)