@bucanero eno
it's working here too. Although, I had to add in filefn.cpp : #include "os.hpp". It wasn't able to link "access" function from unistd.h in the elf when I was compiling mgz.
PS: it supports RAR5 too :p

#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
int access(const char *fn, int flags)
{
struct stat s;
if (stat(fn, &s))
return -1;
if (s.st_mode & S_IFDIR)
return 0;
if (flags & W_OK)
{
if (s.st_mode & S_IWRITE)
return 0;
return -1;
}
return 0;
}
I downloaded your unrar-master repo. I was able to build libunrar.a, but compiling the example doesn't find unrar.h
anyone interest for 7z compressed file?
7z is also important like unrar,zip?
is there anyway extract 7z file using ps3?
sorry, as Zar said, "unrar.h" is created in portlibs/include when you "make install" the library. The original file is "dll.hpp" but honestly it made no sense to have such generic filename in the portlibs folder, so I decided to go with unrar.h .
also, keep an eye in the access() function, if you don't have a recent build of PSL1GHT that call will be missing when linking the final binary. You can fix it by adding your own access() function. See my previous post with the code for the emulated access with stat().
let me know if it worked, I'll try to update the example with another 2 cases, 1 for "list .RAR contents" and another for "test .RAR contents"
also, I'll probably rename the github repo to libunrar-ps3 , and add a proper README.md with instructions to build/install the library.
@bucanero I implemented your zip, 7z & rar libraries in the PKGLAUNCH.
https://github.com/aldostools/webMAN-MOD/tree/master/_Projects_/wm_url_launcher
7zip and zip worked without issues. However I could not get the unrar library working with PKGLAUNCH,
but your example in github worked fine when I called it from PKGLAUNCH.
Do you have any idea about what could be happening?
unrar_extract("/dev_hdd0/tmp/archive.rar", "/dev_hdd0/tmp/");
unrar_extract(path, "/dev_hdd0/tmp");
unrar_extract("/dev_hdd0/tmp/archive.rar", dest_path);
mmm... from what I saw, the only place you're calling unrar_extract(...) is here, right?:
https://github.com/aldostools/webMA...d5c50b/_Projects_/wm_url_launcher/main.c#L221
you say that if you call this line from PKGLAUNCH it works:
Code:unrar_extract("/dev_hdd0/tmp/archive.rar", "/dev_hdd0/tmp/");
if the code from my example worked, could you try this?
andCode:unrar_extract(path, "/dev_hdd0/tmp");
Code:unrar_extract("/dev_hdd0/tmp/archive.rar", dest_path);
if that first change works, then it's something about the dest_path , but if it still fails and change #2 works, then I guess it's something related to the source path?
btw, my example is using a source file from /dev_hdd0 , PKGLAUNCH is opening the file from hdd0 or maybe somewhere else like dev_bdvd ?
note: I've fixed a .zip creation bug in Apollo, if the folder had more folders inside, they where not added. You can get the updated code here:
https://github.com/bucanero/apollo-ps3/blob/master/source/zip_util.c
I think the issue was related to the available memory stack. I fixed the issue calling the external SELF (a modified version of example), instead of including RAR library into the project. The call from PKGLAUNCH uses a stack of 1MB.
In regards to the function extract_zip() in your zip_util.c I noticed that you call mkdirs before on every file.
You can speed up the zip extraction, creating the directories only when you find an entry that ends with '/'
https://github.com/aldostools/webMAN-MOD/blob/master/_Projects_/wm_url_launcher/zip_util.h#L141
Also the mkdirs is checked after the extract path, not from the root (first character in the path).
Also your extract buffer is 4KB (0x1000), Increasing it to 1MB (0x100000) helps to speed up the zip extraction.
README.TXT
ARCHIVE.BIN
SOMEDIR/
SOMEDIR/FILE.GIF
SOMEDIR/FILE.BIN
OTHER/
OTHER/IMAGE.PNG
README.TXT
ARCHIVE.BIN
SOMEDIR/FILE.GIF
SOMEDIR/FILE.BIN
OTHER/IMAGE.PNG

...as I couldn't trust the tool that generated the .zip , I went with the overhead of calling mkdir on every file.
Yes, I forgot to mention that optimization. I already did that too:btw, talking about the buffer, I'm thinking that it could be better to do just one malloc(buffer_size) at the beginning, and then re-use the same buffer for all the files unzipping, instead of a malloc(...) and free(...) for each file we unpack. That would speed up a bit too, reducing malloc/free calls and hopefully less memory fragmentation.
a small note about the unRAR ps3 library,
it has been added by Eugene Roshal to the official list of RAR tools here: https://www.rarlab.com/rar_add.htm
![]()

I guess making a file manager with the feature to extract zip, rar and 7zip(maybe more) can be useful for some user's. Multiman idk if it can extract large files but it surely can't extract file with multiple folders(was extracting gow3.zip and was given a blank folder. If you feel bored and have time surely make a file managerI was bored today and I modified the unrar source to compile on PS3 (psl1ght)
so now I have a nice libunrar.a lying around
the question is, could it be useful for something? maybe including it in a file manager, if supporting .RAR files has any advantage for users... any other ideas?
btw, if anyone wants I can upload the source and changes to GitHub
cheers
I guess making a file manager with the feature to extract zip, rar and 7zip(maybe more) can be useful for some user's. Multiman idk if it can extract large files but it surely can't extract file with multiple folders(was extracting gow3.zip and was given a blank folder. If you feel bored and have time surely make a file manager