VFS plugin for dynamic collection of files

Hi Leo I didn't know about @nolocalizefiles but that is exactly what I want! Thanks

1 Like

The current beta (12.12.2) has added the VFS_TestSameDrive and VFS_TestSamePath plugin functions which you'll need to implement to get the "move by rename" stuff working.

We haven't updated the SDK yet but this should be enough for you to add them. The definitions are:

typedef BOOL (*PFNVFSTESTSAMEDRIVE)(HANDLE hVFSData,LPCWSTR pszPath1, LPCWSTR pszPath2, DWORD dwFlags);
typedef BOOL (*PFNVFSTESTSAMEPATH)(HANDLE hVFSData,LPCWSTR pszPath1, LPCWSTR pszPath2, DWORD dwFlags);

VFS_TestSameDrive() should return TRUE if the two paths are on the same "drive" (whatever this means as far as your plugin is concerned).
VFS_TestSamePath() should return TRUE if the two paths resolve to the same location.

The dwFlags parameters aren't used as yet.

1 Like

Wow. It works. You didn't want to name them VFS_TestSameDriveW and VFS_TestSamePathW? I must admit when I first implemented them I added the W just cause that's how everything else is. But you didn't call them so I dropped the W and it worked. I trace the flow as:

TID:10328 VFS_GetFreeDiskSpaceW
TID:36652 VFS_TestSamePath
TID:36652 VFS_GetLastError
TID:36652 VFS_TestSameDrive
TID:36652 VFS_GetFileInformationW
TID:36652 VFS_GetFileAttrW
TID:36652 VFS_GetLastError
TID:36652 VFS_MoveFile
TID:4628 VFS_GetFileInformationW

For all of my purposes I actually had VFS_GetFileInformationW hardcoded and short circuiting to return false since opus did not seem to care, it relied on GetFileAttrW for existence check. But in this case that caused both SamePath and SameDrive to fail. So I removed the hardcode and it started working right away.

Thanks for your help!!

New APIs won't get A (ANSI) versions so the W (Wide/Unicode) suffix isn't needed to separate A from W versions of the same API.