ethernidee / vfs

Add Virtual File System support to your project. Implement Mods directory support in 2 lines of code
GNU Affero General Public License v3.0
1 stars 1 forks source link

Is it OS-level virtual file system? #1

Open edwinyzh opened 5 years ago

edwinyzh commented 5 years ago

I'm glad to discover this project!

Is it a virtual file system on the OS level?
What's the minimum compiler? I tried compile VfsTest.dpr with XE4 but failed with the following error:

[dcc32 Error] StrLib.pas(512): E2015 Operator not applicable to this operand type

Thanks.

ethernidee commented 5 years ago

Hi, thank you! I'm sorry for missing detailed readme. The primary usage of VFS.dll was Era project for Heroes of Might and Magic 3 game.

It's software-level library. It hooks (intercepts) low-level ntdll.dll functions:

NtQueryAttributesFile NtQueryFullAttributesFile NtOpenFile NtCreateFile NtClose NtQueryDirectoryFile

It allows to map (virtually copy contents) any directory to any directory without actually copying files. For instance, you may have Mods directory, where each mod is kept in its own subdir and each mod contents is mapped to application root directory, say: D:\App\Mods\Test\Mp3\main_menu.mp3 is mapped to D:\App\Mp3\main_menu.mp3

Mod can be installed by unpacking and deleted by directory removal. No need to overwrite real files or resolve conflicts.

It's a read-only file system. If you try to open file for write or delete file, its path will not be redirected.

I use Delphi 2007, because all strings are AnsiStrings and thus Delphi 2009+ cannot be used. Anyway, there is compiled library in releases and VfsImport.pas with API.

edwinyzh commented 5 years ago

@ethernidee Thanks for the clarification.