Jump to content
  • Advertisement
Sign in to follow this  
themean

PHYSFS_enumerateFiles don't work

This topic is 2209 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Here is my test example:



[color=#000080]#include[color=#c0c0c0] [color=#008000]<iostream>

[color=#000080]#include[color=#008000]<physfs.h>



[color=#808000]int[color=#c0c0c0] main[color=#000000]()
[color=#000000]{

[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<[color=#008000]"begin"[color=#000000]<<[color=#800080]std[color=#000000]::endl[color=#000000];

[color=#c0c0c0] PHYSFS_init[color=#000000](NULL[color=#000000]);

[color=#c0c0c0] [color=#808000]if[color=#000000](PHYSFS_mount[color=#000000]([color=#008000]"myzip.zip"[color=#000000],[color=#000080]0[color=#000000],[color=#000080]1[color=#000000]))
[color=#c0c0c0] [color=#000000]{
[color=#c0c0c0] [color=#808000]char[color=#c0c0c0] [color=#000000]**[color=#000000]rc[color=#c0c0c0] [color=#000000]=[color=#c0c0c0] PHYSFS_enumerateFiles[color=#000000]([color=#008000]"folder"[color=#000000]);
[color=#c0c0c0] [color=#808000]char[color=#c0c0c0] [color=#000000]**[color=#000000]i[color=#000000];

[color=#c0c0c0] [color=#808000]if[color=#000000](!*[color=#000000]rc[color=#000000])
[color=#c0c0c0] [color=#000000]{
[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<[color=#008000]"Can't[color=#c0c0c0] [color=#008000]print[color=#c0c0c0] [color=#008000]file[color=#c0c0c0] [color=#008000]list"[color=#000000]<<[color=#800080]std[color=#000000]::endl[color=#000000];
[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<PHYSFS_getLastError[color=#000000]()<<[color=#800080]std[color=#000000]::endl[color=#000000];
[color=#c0c0c0] [color=#000000]}
[color=#c0c0c0] [color=#808000]for[color=#c0c0c0] [color=#000000]([color=#000000]i[color=#c0c0c0] [color=#000000]=[color=#c0c0c0] [color=#000000]rc[color=#000000];[color=#c0c0c0] [color=#000000]*[color=#000000]i[color=#c0c0c0] [color=#000000]!=[color=#c0c0c0] NULL[color=#000000];[color=#c0c0c0] [color=#000000]i[color=#000000]++)
[color=#c0c0c0] [color=#000000]{

[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<[color=#008000]"We've[color=#c0c0c0] [color=#008000]got"[color=#000000]<<*[color=#000000]i[color=#000000]<<[color=#800080]std[color=#000000]::endl[color=#000000];
[color=#c0c0c0] [color=#000000]}

[color=#c0c0c0] PHYSFS_freeList[color=#000000]([color=#000000]rc[color=#000000]);
[color=#c0c0c0] [color=#000000]}

[color=#c0c0c0] [color=#808000]else
[color=#c0c0c0] [color=#000000]{
[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<[color=#008000]"Can't[color=#c0c0c0] [color=#008000]add[color=#c0c0c0] [color=#008000]search[color=#c0c0c0] [color=#008000]path"[color=#000000]<<[color=#800080]std[color=#000000]::endl[color=#000000];
[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<PHYSFS_getLastError[color=#000000]()<<[color=#800080]std[color=#000000]::endl[color=#000000];
[color=#c0c0c0] [color=#000000]}

[color=#c0c0c0] [color=#800080]std[color=#000000]::cout[color=#000000]<<[color=#008000]"end"[color=#000000]<<[color=#800080]std[color=#000000]::endl[color=#000000];

[color=#c0c0c0] PHYSFS_deinit[color=#000000]();
[color=#c0c0c0] [color=#808000]return[color=#c0c0c0] [color=#000080]0[color=#000000];
[color=#000000]}






[font=arial,helvetica,sans-serif][color=#000000]"myzip.zip" is archive of "myzip" folder that contain sub folder "folder"
[color=#000000]My application output is:[/font]


[font=arial,helvetica,sans-serif][color=#000000]begin[/font]
Can't print file list
File not found
end

My operation system is debian squeeze Edited by themean

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!