I am developing an application, which should mount a folder over the network. It should show up similiar to a folder mounted by SMB, only that the server does not use the SMB protocol. It is similiar to this: Server A is a HTTP server, that contains files and Client B should be able to mount those files, to be directly able to access them without downloading them first (streaming). The client should thus be able to stream files, i.e. accessing the file at arbitrary positions. Also the files stored on Server A are encoded, compressed, encrypted and packetized in a specific way, so I need to decode them (do some internal processing) before presenting them to the virtual file system. The client should have read-only access. I want the client to be available on Windows and Linux. It should look like this:
Client has mounted a folder and wants to access /virtualfolder/data.file at position 1248989. The data stored on the server is split in blocks of arbitrary lengths (let's say it is 1 megabyte). I then need to download the part of the file corresponding to bytes 1000000 - 1999999, decode them, cache them and then the user can access this data.
Of course my decoding process is done internally, I just need an API to create a virtual folder (or filesystem) on the OS, that shows up the names of the files and their sizes and lets the user access them.
It should look like this: [OS] <-virtual filesystem API-> [Client] <-some protocol-> [Server]
Accessing a file should look like this:
[OS] I want to get the bytes 0-255 from file /vfs/somefile.tar
[Client] Retrieving block 0-999999 from file /vfs/somefile.tar from server. This corresponds to block B5F997084DC8687. Downloading B5F997084DC8687 and decoding it.
[Client] Here is /vfs/somefile.tar from 0-255.
[OS] I want to get the bytes 256-511 from file /vfs/somefile.tar
[Client] This corresponds to B5F997084DC8687. Already downloaded and cached this file.
[Client] Here is /vfs/somefile.tar from 256-511.
Pretty straightforward I assume. Is there a simple API for such things?