View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 320
|
Posted: Wed Apr 23, 2014 3:07 pm Post subject: Copying stuff to a memory address |
|
|
For reasons too complicated to go into, we have a series of arrays and variables that we'd like to "get a handle to" via a single address.
We could do it by writing/reading to/from a scratch file but wondered if there was any way to do it "in memory" (for speed as much as anything else).
So, i think what I'm asking is whether there's a way to do an unformatted write/read to/from an internal "unlimited-length" character buffer...
Any thoughts/tricks appreciated!
K |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2621 Location: Sydney
|
Posted: Thu Apr 24, 2014 8:03 pm Post subject: |
|
|
You could try memory routines. See help for:
* Storage management routines
* Other machine-level facilities
This may help
John |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8255 Location: Salford, UK
|
Posted: Thu Apr 24, 2014 9:21 pm Post subject: |
|
|
See also "Extended ALLOCATE statement" |
|
Back to top |
|
 |
KennyT
Joined: 02 Aug 2005 Posts: 320
|
Posted: Fri Apr 25, 2014 9:44 am Post subject: |
|
|
Thanks for the replies, i'll take a look.
K |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2415 Location: Yateley, Hants, UK
|
Posted: Fri Apr 25, 2014 2:11 pm Post subject: |
|
|
The scratch file isn't as bad as you think, as providing you access it soon after creating and it is small enough (which is still pretty big!) it is still in the cache.
Alternatively, you can use RAMdisk software and read and write a scratch disk there.
In both cases, you are using very standard Fortran code.
If you need the information to be available to multiple programs, then you can't use an automatically-named file, you have to give it a name that all other programs 'know'.
Eddie |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2621 Location: Sydney
|
Posted: Tue Apr 29, 2014 5:31 am Post subject: |
|
|
If you are going to use scratch files, be warned that opening and closing the same file many times in Windows does have some known problems, as there can be delays releasing file handles when closing files.
John |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2415 Location: Yateley, Hants, UK
|
Posted: Tue Apr 29, 2014 11:03 am Post subject: |
|
|
I thought it might only be one file.
Some things in Windows aren't great :(
E |
|
Back to top |
|
 |
|