I have to download files from the web over several requests. The
downloaded files for each request have to be put in a folder with the
same name as the request number.
For example:
My script is now running to download files for request number 87665. So
all the downloaded files are to be put in the destination folder Current
Download\Attachment87665. So how do I do that?
Destination folder: Current Download is fixed. only need to create
Attachmentxxxxxx dynamically, where xxxxxx any request number.
This is Python version of code: but I want it in a Ruby, just for your
reference to understand what I am looking for
My script is now running to download files for request number 87665. So
all the downloaded files are to be put in the destination folder Current
Download\Attachment87665. So how do I do that?
Function FileUtils#mkdir_p makes sure that all intermediate
directories are created when creating a path.
Carlo
···
Subject: Can I create directories with dynamic names on run time using Ruby1.9?
Date: Thu 10 Jan 13 04:46:05PM +0900
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
Subject: Can I create directories with dynamic names on run time using
Ruby1.9?
Date: Thu 10 Jan 13 04:46:05PM +0900
Quoting Arup Rakshit (lists@ruby-forum.com):
My script is now running to download files for request number 87665. So
all the downloaded files are to be put in the destination folder Current
Download\Attachment87665. So how do I do that?
Function FileUtils#mkdir_p makes sure that all intermediate
directories are created when creating a path.
Carlo
Can I have a simple `snippet` for that, I am totally new to Ruby. I have
Ruby 1.9.3 installed in my PC(windows 7)
path = "string to the folder"
FileUtils.mkdir_p(path)
···
-----
Carlos Agarie
Control engineering
Polytechnic School, University of São Paulo, Brazil
Computer engineering
Embry-Riddle Aeronautical University, USA
2013/1/10 Arup Rakshit <lists@ruby-forum.com>
Carlo E. Prelz wrote in post #1091698:
> Subject: Can I create directories with dynamic names on run time using
> Ruby1.9?
> Date: Thu 10 Jan 13 04:46:05PM +0900
>
> Quoting Arup Rakshit (lists@ruby-forum.com):
>
>> My script is now running to download files for request number 87665. So
>> all the downloaded files are to be put in the destination folder Current
>> Download\Attachment87665. So how do I do that?
>
> Function FileUtils#mkdir_p makes sure that all intermediate
> directories are created when creating a path.
>
> Carlo
Can I have a simple `snippet` for that, I am totally new to Ruby. I have
Ruby 1.9.3 installed in my PC(windows 7)
This results (if you have the appropriate rights) in the creation of
these directories:
/a
/a/b
/a/b/c
/a/b/c/d
Carlo
···
Subject: Re: Can I create directories with dynamic names on run time using Ruby1.9?
Date: Thu 10 Jan 13 04:55:12PM +0900
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
path = "string to the folder"
FileUtils.mkdir_p(path)
-----
Carlos Agarie
Control engineering
Polytechnic School, University of So Paulo, Brazil
Computer engineering
Embry-Riddle Aeronautical University, USA
have you watched my `Python` snippet? Look at that how it is
concatenating and checking if that file exist or not? then dynamically
creating the folders with that name.