Creating Virtual Files
Virtual files can be created explicitly and implicitly. Explicitly, a virtual file can be created with the following functions:
- BoxedAppSDK_CreateVirtualFile creates a virtual file with the contents located in the shared memory.
- BoxedAppSDK_CreateVirtualFileBasedOnIStream - creates a virtual file with the behavior determined by the implementation of the standard interface IStream.
- BoxedAppSDK_CreateVirtualFileBasedOnBuffer - creates a virtual file with the contents located in the memory buffer, which is used when reading and for writing.
- BoxedAppSDK_CreateVirtualDirectory - creates a virtual directory with the contents located in the shared memory.
Implicitly, a virtual file can appear when the "all changes are virtual" mode is on. In this mode, a virtual file is created when you create a new file. If the parent directory of the file was created with BoxedAppSDK_CreateCustomVirtualDirectory, the same method will be called for creating a file within it. And if the parent directory is neither a virtual file nor a file created with BoxedAppSDK_CreateVirtualDirectory, then, depending on whether it's a directory or a regular file that is to be created, BoxedApp will use the BoxedAppSDK_CreateVirtualFile or BoxedAppSDK_CreateVirtualDirectory method.