PHYSFS_getRealDir:<br>I understand that calling this with a fake directory will result in returning the first archive mounted to the fake directory's location. My question is if I've mounted a real directory as a fake VFS directory, like mounting /home/user to VFS:/myusr, why shouldn't it return the real directory of /myusr as /home/usr? If I create a file inside /myuser, the file is real and not just in the VFS.<br>
<br>PHYSFS_isDirectory:<br>Using the /myuser example above, if I call this on /myuser I get a list of nothing but files, instead of a mix of files and directories as I would expect. Even if this was a fake directory instead of a real file system I would think that directories would show up correctly. Is this the correct behavior?<br>
<br>This is all using 2.0 stable. Here's some test code and the output, in case I'm just being thick - nothing new :D<br><br><br><span style="font-family: courier new,monospace;">#include "physfs.h"</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#include <stdio.h></span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">void get_dir_listing(const char* path)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> char** rc;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> char** i;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> rc = PHYSFS_enumerateFiles(path);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> for (i = rc; *i != NULL; i++)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if (PHYSFS_isDirectory(*i))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">          printf("Directory [%s]\n", *i);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">          printf("File [%s]\n", *i);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> PHYSFS_freeList(rc);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">int main(int argc, char** argv)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> PHYSFS_init(argv[0]);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> PHYSFS_mount("/home/estevens/games/tome3", NULL, 0);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> PHYSFS_mount("/home/estevens/.t-engine/3.0", "/userdir", 1);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> printf("\nreal dir of /userdir/log: %s\n", PHYSFS_getRealDir("/userdir/log"));</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> printf("\nContents of '/'\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> get_dir_listing("/");</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> printf("\nContents of '/userdir'\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> get_dir_listing("/userdir");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> PHYSFS_deinit();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br><br>The output:<br><font face="courier new,monospace">real dir of /userdir/log: /home/estevens/.t-engine/3.0<br><br>Contents of '/'<br>Directory [game]<br>
Directory [game.mod1]<br>File [tome.cfg]<br>File [tree.txt]<br>Directory [userdir]<br><br>Contents of '/userdir' (all are directories)<br>File [log]<br>File [modules]<br>File [settings]<br>
File [tmp]</font><br style="font-family: courier new,monospace;"><br>