[physfs] Not finding any directories

Berry, David David.Berry at dcita.gov.au
Thu Dec 16 17:51:44 EST 2004


Ok 

Here's the new code

//----------------------------------------------------------------------
----
//
// Get a list of all the files to be played
bool utilGetFileList(char *startPoint)
//----------------------------------------------------------------------
----
{
 char fullPath[MAX_STRING_SIZE];
 
 char **rc = PHYSFS_enumerateFiles(startPoint);
 char **i;
 int result;
 
 for (i = rc; *i != NULL; i++)
 {
     strcpy(fullPath, "");     
     sprintf (fullPath, "%s%s%s", startPoint, PHYSFS_getDirSeparator(),
*i);
     result = PHYSFS_isDirectory(fullPath);
//         if (result != 0)
     logToFile("We've got [%s] - [ %i ].", fullPath, result);
 }
 PHYSFS_freeList(rc);    
 
 return true;
}

Called with: utilGetFileList("test");

Still no go - now it returns:

09:46:49 > We've got [test\dir_1] - [ 0 ].
09:46:49 > We've got [test\dir_2] - [ 0 ].
09:46:49 > We've got [test\file_1.txt] - [ 0 ].
09:46:49 > We've got [test\file_2.txt] - [ 0 ].

I even tried the full path: C:\test\dir_1 and also \test\dir_1

Cheers

-----Original Message-----
From: Ryan C. Gordon [mailto:icculus at clutteredmind.org] 
Sent: Friday, 17 December 2004 9:02 AM
To: physfs at icculus.org
Subject: Re: [physfs] Not finding any directories


> It is showing both files and directories - however,
'PHYSFS_isDirectory' 
 > isn't picking up the difference between a file and a directory.  It
 > should be returning a different result for the two.

It's returning 0 because it can't find "dir_1". "dir_1" doesn't exist. 
"test/dir_1" does, however, and should return 1.

--ryan.








More information about the physfs mailing list