[physfs] Links in PhysicsFS 3.0.0

Ryan C. Gordon icculus at icculus.org
Mon Oct 23 14:56:58 EDT 2017


(As a simple test case for this, one could make a symlink of a dir, run 
test_physfs, and type "mount symlinkpath / 1")

> If I try to mount a directory that is a symlink, PHYSFS_getLastError 
> reports "unsupported". Using a hard copy instead of a link resolves this 
> issue.

I see what's happening. This code here...

https://hg.icculus.org/icculus/physfs/file/0bbfaf6c5508/src/physfs_archiver_dir.c#l52

...sets st.filetype to PHYSFS_FILETYPE_SYMLINK and fails out.

> Personally I have not tested, but other people I know say that links do 
> work on Windows with PhysicsFS 3.0.0.

There's several ways to do "symlinks" on Windows; if they do an NTFS 
junction point, it's sort of like a symlink, but not quite, and it'll 
pass the test that check.

https://hg.icculus.org/icculus/physfs/file/0bbfaf6c5508/src/physfs_platform_windows.c#l939

...which leads to it skipping this "if" to the next "else if" where it 
declares it's actually a directory, and everything happens to work.

https://hg.icculus.org/icculus/physfs/file/0bbfaf6c5508/src/physfs_platform_windows.c#l987

--ryan.



More information about the physfs mailing list