Forum: Ruby Moving Files from a CGI Script

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7863582496e914f1ffce56f98d468f72?d=identicon&s=25 Nathan Olberding (nko)
on 2006-06-12 17:56
I'm looking to use a CGI script to move / rename a directory. I can't
find anything under Dir:: or File:: that looks appropriate and making a
shell command `in back-ticks` is out of the question as I'm using POST
data to determine which directory to move. What's the appropriate
mechanism for moving files in Ruby?
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-06-12 18:09
(Received via mailing list)
On Tue, 13 Jun 2006, Nathan Olberding wrote:

> I'm looking to use a CGI script to move / rename a directory. I can't
> find anything under Dir:: or File:: that looks appropriate and making a
> shell command `in back-ticks` is out of the question as I'm using POST
> data to determine which directory to move. What's the appropriate
> mechanism for moving files in Ruby?

ri FileUtils

-a
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (regularfry)
on 2006-06-12 18:10
(Received via mailing list)
Nathan Olberding wrote:
> I'm looking to use a CGI script to move / rename a directory. I can't
> find anything under Dir:: or File:: that looks appropriate and making a
> shell command `in back-ticks` is out of the question as I'm using POST
> data to determine which directory to move. What's the appropriate
> mechanism for moving files in Ruby?
>
Will FileUtils::mv do what you want?
7863582496e914f1ffce56f98d468f72?d=identicon&s=25 Nathan Olberding (nko)
on 2006-06-12 18:16
Alex Young wrote:
> Will FileUtils::mv do what you want?

FileUtils looks perfect! Thanks. Every time I feel like I'm getting
somewhere with Ruby, I find out I've been missing some obvious bit the
whole time. I couldn't even find this on Google!
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-06-12 18:32
(Received via mailing list)
On Tue, 13 Jun 2006, Nathan Olberding wrote:

> Alex Young wrote:
>> Will FileUtils::mv do what you want?
>
> FileUtils looks perfect! Thanks. Every time I feel like I'm getting
> somewhere with Ruby, I find out I've been missing some obvious bit the
> whole time. I couldn't even find this on Google!

download the source.  look in the lib/ dir.  it's all there.
alternatively
use

   http://ruby-doc.org/

it's all there too.

-a
7863582496e914f1ffce56f98d468f72?d=identicon&s=25 Nathan Olberding (nko)
on 2006-06-12 18:43
unknown wrote:
>    http://ruby-doc.org/
>
> it's all there too.

That's the first place I looked. I glossed over the modules listed below
File without thinking about it. There were a lot of them, and usually in
a situation like that, I end up going down a lot of dead-end roads. Just
goes to show what I get for being cynical!
This topic is locked and can not be replied to.