get files by its extension

I

Idealone Ideally

Hi Guys,
I want to download certain file types or certain files by its
name using ruby code.
example:
In Shell scripting, I can say cp *.txt, which inturn copies all files
with extension ".txt",
similarly i can say cp test* , all files with the string "test" are
copied.

I want to achieve similar tasks using ruby code, as i am novice using
ruby.
My purpose is that i am connecting to my Linux server through ftp and
trying to download files with certain extension.
Let me know if any more info is required from my end


cheers
Thanks in Advance
 
V

vimal

Hi Guys,
         I want to download certain file types or certain filesby its
name using ruby code.
example:
In Shell scripting, I can say cp *.txt, which inturn copies all files
with extension ".txt",
similarly i can say cp test* , all files with the string "test" are
copied.

  I want to achieve similar tasks using ruby code, as i am novice using
ruby.
My purpose is that i am connecting to my Linux server through ftp and
trying to download files with certain extension.
Let me know if any more info is required from my end

cheers
Thanks in Advance

Dir.glob('*.txt')

Regards,
Vimal Das
 
V

vimal

Sorry for the intervention guys, i didn't get your question properly.

Regards,
Vimal Das
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,947
Members
47,498
Latest member
yelene6679

Latest Threads

Top