[physfs] Question regarding PHYSFS_getRealDir and PHYSFS_isDirectory

Eric Stevens estevens05 at gmail.com
Sun Feb 28 23:14:14 EST 2010

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.

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

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

#include "physfs.h"
#include <stdio.h>

void get_dir_listing(const char* path)
  char** rc;
  char** i;

  rc = PHYSFS_enumerateFiles(path);

  for (i = rc; *i != NULL; i++)
     if (PHYSFS_isDirectory(*i))
        printf("Directory [%s]\n", *i);
        printf("File      [%s]\n", *i);


int main(int argc, char** argv)
  PHYSFS_mount("/home/estevens/games/tome3", NULL, 0);
  PHYSFS_mount("/home/estevens/.t-engine/3.0", "/userdir", 1);

  printf("\nreal dir of /userdir/log: %s\n",

  printf("\nContents of '/'\n");

  printf("\nContents of '/userdir'\n");


  return 0;

The output:
real dir of /userdir/log: /home/estevens/.t-engine/3.0

Contents of '/'
Directory [game]
Directory [game.mod1]
File      [tome.cfg]
File      [tree.txt]
Directory [userdir]

Contents of '/userdir' (all are directories)
File      [log]
File      [modules]
File      [settings]
File      [tmp]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20100228/5d6a853a/attachment.htm>

More information about the physfs mailing list