Hi,
I would like to make a filename list of files from all archives loaded in the Irrlicht FileSystem. However the "createFileList" function do not give any of the files contained in archives previously loaded, just other normal files...
Is there a way to acess to there archived files (get their filename)?
Thank a lot in advance,
Stef.
FileList containing added archive files?
Hi again,
I saw some other people having trouble with the same problem.
And here I can see that obviously this file system feature will come on 1.6 next release
However for those who want a file list of zipped files, I found something to manage to do this. A really little library, in fact more a peace of code witch allow you to do some basic operations on zip files, including retrieving some filenames.
You can get the code here :
http://www.codeproject.com/KB/files/zip_utils.aspx
And here is an exemple to show all files (filenames) of zip file on the console out :
Hope it will help some people!
Stef.
[/code]
I saw some other people having trouble with the same problem.
And here I can see that obviously this file system feature will come on 1.6 next release
However for those who want a file list of zipped files, I found something to manage to do this. A really little library, in fact more a peace of code witch allow you to do some basic operations on zip files, including retrieving some filenames.
You can get the code here :
http://www.codeproject.com/KB/files/zip_utils.aspx
And here is an exemple to show all files (filenames) of zip file on the console out :
Code: Select all
//getting all filenames from all zip archives (CMD display)
IFileSystem *filesys=device->getFileSystem();
IFileList *fileList=filesys->createFileList();
for(u32 i=2; i<fileList->getFileCount(); i++) {
string *filename=new std::string(fileList->getFileName(i));
string *extention=new std::string(filename->substr(filename->length()-4,4));
if(memcmp(extention->data(), ".zip", 4)==0) {
//we found a zip file, we're going to analyse it :
HZIP zipFile=OpenZip(filename->c_str(),0);
ZIPENTRY infos;
GetZipItem(zipFile, -1, &infos);
int itemCount=infos.index;
for(int i=0; i<itemCount; i++) {
ZIPENTRY zipFileEntry;
GetZipItem(zipFile, i, &zipFileEntry);
cout<<"archive file : "<<zipFileEntry.name<<endl;
}
}
}
Stef.
[/code]
How come this works? ? ?stefbuet wrote:Code: Select all
//std:string = irr::io::path string *filename=new std::string(fileList->getFileName(i));
I get C2664 in VS and its rather correct(?)