Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memory Disk

Status
Not open for further replies.

RichardF

Programmer
Oct 9, 2000
239
GB
Hi,

I know, it seems a little strange to have a memory disk these days with all the space we have !

Im actually interested because its probally quicker to read a file from memory than from HD.

Heres the story :
I have an API call that takes a filename as a parameter.

Can i copy a file into a "memory disk" and then pass the path to the API call ? to achieve faster load times ?
using win2k/vc6.

 
I believe, that file caching, invented when smartdrv.sys has appeared, optimizes disk i/o time, that all i/o operations, when it is possible, are made in memory, and RAM disks are no more needed.
 
Yes mingis is correct, plus of course Memory Mapped Files!

-pete
 
I have a similar question. I have a series of files that have been concatenated into one large file. I have an api that requires a pathname. Is there a way to access the individual files without reading and writing a new file.

In essence, I want something like

CreateFileInMemory(strFilename, // Virtual filename
strDiskFilename, // Disk filename
dwOffset, // Offset at which
// virtual file begins
dwSize ) // size of virtual file

Then, I want to make calls like:

MyLib.Open(strFilename);
MyLib.DoStuff ...

Alternatively, I could read

fopen(strDiskFilename,"r");
fread(pBuffer,dwOffset,dwSize);

and then I'd need a function like

CreateVirtualFile(strFilename,pBuffer,dwSize);

MyLib.Open(strFilename);
MyLib.DoStuff ...

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top