Date: Tue, 21 Sep 2010 00:16:48 -0500 From: Ryan Coleman <editor@d3photography.com> To: Matthew Seaman <m.seaman@infracaninophile.co.uk> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: Zip file making issues Message-ID: <F6EDE677-D936-43A0-878F-D1B58D866757@d3photography.com> In-Reply-To: <4C983F1F.700@infracaninophile.co.uk> References: <A166139D-842F-4ACA-B8B3-687A8C6ECE01@d3photography.com> <F7E03E13906D419C8417713D17CF49C9@hermes> <70BA7AC2-7300-41F6-9D3E-7AFEAD7F533E@d3photography.com> <4C983F1F.700@infracaninophile.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
That changing of directories doesn't solve the PHP script I have = building ZIP files, though, with a single shell command (path/to/zip = /path/to/zip.zip -r /path/to/folder/to/zip). But I have solved this now with another PHP script that I can call both = as part of my Apache CGI but also as a CLI. I just have to implement it which I will do in the morning. -- Ryan On Sep 21, 2010, at 12:14 AM, Matthew Seaman wrote: > On 21/09/2010 04:53:58, Ryan Coleman wrote: >> As I said in my OP: I could just run a "cd" to the directory parent >> and do it there - that would solve the problem - but that's simply >> too dangerous if the script generator throws an error on the next set >> of commands (a risk I do not want to take). >=20 > Um.... changing directory *is* the way to solve this. Really. >=20 > What you can do in a shell script is work in a sub-shell: that way, > even if your zip command goes bananas, you are automatically returned = to > your original working directory. To create a sub-shell, just enclose > your commands in (brackets). >=20 > ( > cd /mount/archive/orders/Sep20/1284343047-Le-ach/ ; > zip -r > = /usr/www/d3photography.com/htdocs/images/paidphotos/1284343047-Le-ach.zip = \ > download* > ) >=20 > Cheers, >=20 > Matthew >=20 > --=20 > Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard > Flat 3 > PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate > JID: matthew@infracaninophile.co.uk Kent, CT11 9PW >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F6EDE677-D936-43A0-878F-D1B58D866757>