Real Software Forums
http://forums.realsoftware.com/

Unar en Lsar
http://forums.realsoftware.com/viewtopic.php?f=7&t=47987
Page 1 of 1

Author:  Bodevinaat [ Mon May 27, 2013 9:32 am ]
Post subject:  Unar en Lsar

Unar and Lsar are command line utilities used to unarchive compressed files. I downloaded them at http://code.google.com/p/theunarchiver/ ... p&can=2&q=

I use this shell script:
dim archive as Shell
dim f as FolderItem
dim theArchive as String
theArchive = "afile.rar"
archive = new shell
archive.mode=0
dim cmd as string

cmd="unar -q"+ chr(32) + theArchive
archive.execute cmd
msgbox(archive.Result)


Bash gives me a 'bash: unar: command not found' response. Though I triplechecked that the unary executable is in the same folder.
When I run a terminal I get the same response, though clicking on the unar file itself gives me the 'help' response.

Do I have to add something to the script? I'm not very familiar with Unix....

Author:  charonn0 [ Mon May 27, 2013 10:46 am ]
Post subject:  Re: Unar en Lsar

Make sure the file permissions are set as executable on the two utility programs. See: http://www.macinstruct.com/node/415

Author:  Bodevinaat [ Mon May 27, 2013 12:18 pm ]
Post subject:  Re: Unar en Lsar

charonn0 wrote:
Make sure the file permissions are set as executable on the two utility programs. See: http://www.macinstruct.com/node/415

Done!
Image

Rights: -rwxr-xr-x@ 1 Sander staff 4726632 6 apr 02:04 unar (as screenshot/dropbox didn't work)


Unfortunately... still got the 'Command not found' message... :shock:

Author:  DaveS [ Mon May 27, 2013 12:47 pm ]
Post subject:  Re: Unar en Lsar

I have not tried this yet.. but just an idea...

Since OSX recognizes RAR files..... why not just use F.LAUNCH?

where F is a Folderitem with a proper path to your "afile.rar"?

Author:  Bodevinaat [ Mon May 27, 2013 3:23 pm ]
Post subject:  Re: Unar en Lsar

DaveS wrote:
I have not tried this yet.. but just an idea...

Since OSX recognizes RAR files..... why not just use F.LAUNCH?

where F is a Folderitem with a proper path to your "afile.rar"?


Thanks Dave,

I will look into that. My application must be able to decompress .ZIP and .RAR files. ZIP is easy with the ZLIB library, I useThomas Tempelmann's solution, but RAR... Mmmmm.. tough nut to crack.

Author:  timhare [ Mon May 27, 2013 5:33 pm ]
Post subject:  Re: Unar en Lsar

Quote:
Bash gives me a 'bash: unar: command not found' response. Though I triplechecked that the unary executable is in the same folder.
When I run a terminal I get the same response, though clicking on the unar file itself gives me the 'help' response.

It sounds like "." is not in the PATH. Try "./unar" at the terminal. The fact that clicking the file executes it means that the permissions are fine. The error you're getting means that the system cannot find the file in the normal places. Which means that the current directory is not one of the places it's looking (which is a fairly normal setup for security reasons).

When you use the Shell in your app, it's best to use full path names instead of relying on relative paths. The shell does not inherit the full environment; it's your responsibility to set up the environment as needed for any program you wish to run. This is especially true of the "curent working directory". Don't assume it's the same as your app's.

Author:  Bodevinaat [ Tue May 28, 2013 12:00 pm ]
Post subject:  Re: Unar en Lsar

Quote:
It sounds like "." is not in the PATH. Try "./unar" at the terminal. The fact that clicking the file executes it means that the permissions are fine. The error you're getting means that the system cannot find the file in the normal places. Which means that the current directory is not one of the places it's looking (which is a fairly normal setup for security reasons).


Ok. That worked. So I have to use the full path in my application. I will try later this evening. Many thanks.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/