Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-18-2007, 09:00 PM   #1
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 376

Rep: Reputation: 30
[Ruby] Tar'ing or Zip'ing with ruby script

Is there anyway to pass shell commands through ruby script?

I want to be able to tar or zip files but don't want to have to create a separate script to do this and then have ruby finish the rest of the job.

Is there a way that I can insert a tar or zip command inside of my ruby script?
Old 01-19-2007, 07:29 PM   #2
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Hi, sorry this is somewhat late.

The Zlib module (part of the standard library) has support for zip and gzip handling of files:

Also, the Kernel module has a method "system(cmd, [args]*)" that executes a command in a subshell:

Edit: Yay! This is my (expt 2 9)th post!

Last edited by taylor_venable; 01-19-2007 at 07:32 PM.
Old 01-19-2007, 07:56 PM   #3
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 376

Original Poster
Rep: Reputation: 30
Thanks for the reply, I will give it a shot...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subversion ruby script fails fenrisW0lf *BSD 1 12-21-2007 07:57 PM
need help with a ruby script listing directory contents Joseph Schiller Programming 4 01-01-2007 12:46 AM
cleaning the readability of this ruby script hedpe Programming 1 12-26-2006 03:46 PM
learn c++ before ruby? hottdogg Programming 13 06-17-2005 07:47 PM
Ruby help and advice Geeky_Kid Programming 5 12-31-2003 04:28 AM

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration