Jump to content

  • Log In with Google      Sign In   
  • Create Account

PHYSFS_enumerateFiles don't work


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 themean   Members   -  Reputation: 985

Like
0Likes
Like

Posted 29 June 2012 - 08:57 AM

I'm trying PhysicsFS. But can't get list of all files and directories with PHYSFS_enumerateFiles.

Here is my test example:



#include <iostream>

#include<physfs.h>



int main()
{

std::cout<<"begin"<<std::endl;

PHYSFS_init(NULL);

if(PHYSFS_mount("myzip.zip",0,1))
{
char **rc = PHYSFS_enumerateFiles("folder");
char **i;

if(!*rc)
{
std::cout<<"Can't print file list"<<std::endl;
std::cout<<PHYSFS_getLastError()<<std::endl;
}
for (i = rc; *i != NULL; i++)
{

std::cout<<"We've got"<<*i<<std::endl;
}

PHYSFS_freeList(rc);
}

else
{
std::cout<<"Can't add search path"<<std::endl;
std::cout<<PHYSFS_getLastError()<<std::endl;
}

std::cout<<"end"<<std::endl;

PHYSFS_deinit();
return 0;
}






"myzip.zip" is archive of "myzip" folder that contain sub folder "folder"
My application output is:



begin
Can't print file list
File not found
end

My operation system is debian squeeze

Edited by themean, 29 June 2012 - 09:01 AM.


Sponsor:

#2 themean   Members   -  Reputation: 985

Like
0Likes
Like

Posted 01 July 2012 - 10:22 AM

I solve the problem.I must give root directory to PHYSFS_enumerateFiles or relative path to root.
For example i must give myzip/folder to PHYSFS_enumerateFiles.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS