Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Sep 23, 2017 4:25 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Unar en Lsar
PostPosted: Mon May 27, 2013 9:32 am 
Offline

Joined: Tue Aug 28, 2012 3:52 am
Posts: 28
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....


Top
 Profile  
Reply with quote  
 Post subject: Re: Unar en Lsar
PostPosted: Mon May 27, 2013 10:46 am 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Make sure the file permissions are set as executable on the two utility programs. See: http://www.macinstruct.com/node/415

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Unar en Lsar
PostPosted: Mon May 27, 2013 12:18 pm 
Offline

Joined: Tue Aug 28, 2012 3:52 am
Posts: 28
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:


Top
 Profile  
Reply with quote  
 Post subject: Re: Unar en Lsar
PostPosted: Mon May 27, 2013 12:47 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
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"?

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Unar en Lsar
PostPosted: Mon May 27, 2013 3:23 pm 
Offline

Joined: Tue Aug 28, 2012 3:52 am
Posts: 28
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Unar en Lsar
PostPosted: Mon May 27, 2013 5:33 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Unar en Lsar
PostPosted: Tue May 28, 2013 12:00 pm 
Offline

Joined: Tue Aug 28, 2012 3:52 am
Posts: 28
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group