Hello Indy,<br><br>You are correct, and I've made that correction. Thank you.<br><br>Eric<br><br><div class="gmail_quote">On Sun, Feb 28, 2010 at 11:57 PM, Indy Sams <span dir="ltr"><<a href="mailto:indy@driftsolutions.com">indy@driftsolutions.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello Eric,<br>
<br>
One thing I notice is you aren't including the directory in your call to PHYSFS_isDirectory in get_dir_listing().<br>
<br>
For example, you are using:<br>
PHYSFS_isDirectory("modules")<br>
instead of:<br>
PHYSFS_isDirectory("userdir/modules")<br>
<br>
The 2nd version should give you the results you are looking for.<br>
<br>
Sunday, February 28, 2010, 11:14:14 PM, you wrote:<br>
<br>
ES> PHYSFS_getRealDir:<br>
ES> I understand that calling this with a fake directory will result<br>
ES> in returning the first archive mounted to the fake directory's<br>
ES> location. My question is if I've mounted a real directory as a<br>
ES> fake VFS directory, like mounting /home/user to VFS:/myusr, why<br>
ES> shouldn't it return the real directory of /myusr as /home/usr? If<br>
ES> I create a file inside /myuser, the file is real and not just in the VFS.<br>
<br>
ES> PHYSFS_isDirectory:<br>
ES> Using the /myuser example above, if I call this on /myuser I get<br>
ES> a list of nothing but files, instead of a mix of files and<br>
ES> directories as I would expect. Even if this was a fake directory<br>
ES> instead of a real file system I would think that directories would<br>
ES> show up correctly. Is this the correct behavior?<br>
<br>
ES> This is all using 2.0 stable. Here's some test code and the<br>
ES> output, in case I'm just being thick - nothing new<br>
<br>
<br>
ES> #include "physfs.h"<br>
ES> #include <stdio.h><br>
<br>
ES> void get_dir_listing(const char* path)<br>
ES> {<br>
ES> char** rc;<br>
ES> char** i;<br>
ES><br>
ES> rc = PHYSFS_enumerateFiles(path);<br>
ES><br>
ES> for (i = rc; *i != NULL; i++)<br>
ES> {<br>
ES> if (PHYSFS_isDirectory(*i))<br>
ES> printf("Directory [%s]\n", *i);<br>
ES> else<br>
ES> printf("File [%s]\n", *i);<br>
ES> }<br>
ES><br>
ES> PHYSFS_freeList(rc);<br>
ES> }<br>
<br>
ES> int main(int argc, char** argv)<br>
ES> {<br>
ES> PHYSFS_init(argv[0]);<br>
ES> PHYSFS_mount("/home/estevens/games/tome3", NULL, 0);<br>
ES> PHYSFS_mount("/home/estevens/.t-engine/3.0", "/userdir", 1);<br>
ES><br>
ES> printf("\nreal dir of /userdir/log: %s\n",<br>
ES> PHYSFS_getRealDir("/userdir/log"));<br>
<br>
ES> printf("\nContents of '/'\n");<br>
ES> get_dir_listing("/");<br>
<br>
ES> printf("\nContents of '/userdir'\n");<br>
ES> get_dir_listing("/userdir");<br>
ES><br>
ES> PHYSFS_deinit();<br>
ES><br>
ES> return 0;<br>
ES> }<br>
<br>
ES> The output:<br>
ES> real dir of /userdir/log: /home/estevens/.t-engine/3.0<br>
<br>
ES> Contents of '/'<br>
ES> Directory [game]<br>
ES> Directory [game.mod1]<br>
ES> File [tome.cfg]<br>
ES> File [tree.txt]<br>
ES> Directory [userdir]<br>
<br>
ES> Contents of '/userdir' (all are directories)<br>
ES> File [log]<br>
ES> File [modules]<br>
ES> File [settings]<br>
ES> File [tmp]<br>
<br>
<br>
Best regards,<br>
Indy Sams<br>
mailto:<a href="mailto:indy@driftsolutions.com">indy@driftsolutions.com</a><br>
<br>
P.S. This is what part of the alphabet would look like if Q & R were eliminated.<br>
<br>
_______________________________________________<br>
physfs mailing list<br>
<a href="mailto:physfs@icculus.org">physfs@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/physfs" target="_blank">http://icculus.org/mailman/listinfo/physfs</a><br>
</blockquote></div><br>