.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $8.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old January 27th, 2009, 02:47 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Random: PHP RAR Archive Updating

I'm trying to use the command line rar tool to update a RAR archive on debian, from a PHP script. I can successfully create new archives from my script. I can successfully run a RAR update command to add files to an archive from the shell, as the apache user. But whenever I try to run a RAR update system call from PHP, the RAR tool seems to be unable to work. All RAR outputs is:

Quote:
RAR 3.80 beta 3 ...

Updating archive /path/to/archive.rar
The archive in question is not solid. I cannot get it to contain new files with a "rar a" command or a "rar u", no matter what random switches I add. The baffling thing is that I can trivially su into the apache user and run the exact command I'm trying to run from PHP, and it works!

I also cannot seem to get 7z to update any archives from PHP. Same situation, where I can update them with the same command on the shell as apache user, and I can create new archives from PHP without problem.
Reply With Quote
  #2  
Old January 27th, 2009, 11:49 AM
Xrati's Avatar

Xrati Xrati is offline
First Lieutenant
 
Join Date: May 2005
Location: Outter Glazbox
Posts: 760
Thanks: 12
Thanked 4 Times in 4 Posts
Xrati is on a distinguished road
Default Re: Random: PHP RAR Archive Updating

Try disabling firewall and virus protections.
Reply With Quote
  #3  
Old January 27th, 2009, 12:11 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Random: PHP RAR Archive Updating

One of the first things I would do is have the PHP do "env" and "set" to a file so you can view all of the settings of that user.

Does rar have a "verbose" switch?

Im trying to remember something about update using a temp something to unpack in order to make a comparison. I tihnk a fix was to use the -w switch to assign a work directory. That may be really old fuzzy memory. I will try to google something
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
  #4  
Old January 27th, 2009, 11:38 PM
Captain Kwok's Avatar

Captain Kwok Captain Kwok is offline
National Security Advisor
 
Join Date: Oct 2001
Location: Toronto, Canada
Posts: 5,623
Thanks: 1
Thanked 14 Times in 12 Posts
Captain Kwok is on a distinguished road
Wink Re: Random: PHP RAR Archive Updating

I have nothing useful to suggest, but is this some sort of groundwork for a PBW successor?
__________________
Space Empires Depot | SE:V Balance Mod
Reply With Quote
  #5  
Old January 28th, 2009, 01:40 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: Random: PHP RAR Archive Updating

The suggestion for a -w switch lead me on the right path. I added something under /tmp for it, and it then tried to add the first file. Unfortunately, it added the file in a corrupt manner. Then I stumbled across this little gem in /usr/share/doc/rar/rar.txt:

Quote:
In a UNIX environment you need to quote wildcards to avoid them
being expanded by shell. For example, this command will extract
*.asm files from RAR archives in current path:

rar e '*.rar' '*.asm'
d'oh!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:09 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2019, Shrapnel Games, Inc. - All Rights Reserved.