6

I have a closed source third party API that writes the output data to a file, however I want to read that data and want to process it further.

The API is a library in DLL and takes a regular file path like "C:\someFolder\someFile"

The current setup requires me to save the data from api to a temp file on the disk and then read this temp file to get the data into memory for processing.

Is it possible in windows to have a virtual file or filesystem in main memory with regular path so that the API can write to the main memory instead of disk which would make things faster as there would be no disk access.

Is this possible natively in windows without using any additional software or API installations?

Allahjane
  • 1,920
  • 3
  • 24
  • 42
  • 4
    You should provide additional information, e.g., what is the form of the API. Does it take a pathname? An open file handle? Something else? You say API so does that mean library? web service? What? Also, is this a c++ question as your tag indicates? I don't see why. Maybe choose some tags better able to attract answers. – davidbak May 31 '16 at 19:10
  • 1
    Yes it's possible. It's even possible for _you_ to accomplish if you use something like [Dokan](https://dokan-dev.github.io/). – Captain Obvlious May 31 '16 at 19:12
  • In addition to that: Does the library access the file randomly or only as a stream (think named pipes)? – dhke May 31 '16 at 19:12
  • The third party lib saves some generated data in the file not accesses it , and the lib requires a string pathname to save the file – Allahjane May 31 '16 at 19:16
  • @CaptainObvlious - Not sure Dokan is useful to the OP but it sure will be useful for me - I hadn't heard of it; thanks for the pointer! – davidbak May 31 '16 at 21:03

1 Answers1

2

You can create a named pipe and give the path in a form of \\.\pipe\PipeName to your DLL. Then in your own code connect to the pipe and read. See an example here: Create Named Pipe C++ Windows.

Community
  • 1
  • 1
facetus
  • 1,091
  • 6
  • 20