Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Which File Classto use

Reply
Thread Tools

Which File Classto use

 
 
Zayd Connor
Guest
Posts: n/a
 
      02-03-2009
I am new to Ruby and would like to create a small project that deals
with the file system. The parameters I would like to pass in the command
window would be, how many iterations I would like to run, how many
folders I would like to create, how many files I would like to put
inside those folders, how many I want to open, and close. In the
processI would like to rename the folders and files, and change its
attributes.
Is there one specificfile class I use. or many. I'm have no clue.Do some
classes do the same thing, is one better to use then the other?

I just would like to be pointed in the right direction to get started,
then figure everything else out on my own.

Kindest Regards
Zayd
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Julian Leviston
Guest
Posts: n/a
 
      02-04-2009
Best thing to do is build your program one step at a time. Pick one
feature - say asking number of iterations and doing the loop, putting
a print command to simply show that it's doing something in mock of
the actual code for creating folders and files. Then add the next
thing. Use irb to experiment with the classes to test things out. For
instance, to find out how to use the file class, open irb then ask
File what methods it responds to with File.methods, then try some out.

Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/

On 04/02/2009, at 7:59 AM, Zayd Connor <(E-Mail Removed)> wrote:

> I am new to Ruby and would like to create a small project that deals
> with the file system. The parameters I would like to pass in the
> command
> window would be, how many iterations I would like to run, how many
> folders I would like to create, how many files I would like to put
> inside those folders, how many I want to open, and close. In the
> processI would like to rename the folders and files, and change its
> attributes.
> Is there one specificfile class I use. or many. I'm have no clue.Do
> some
> classes do the same thing, is one better to use then the other?
>
> I just would like to be pointed in the right direction to get started,
> then figure everything else out on my own.
>
> Kindest Regards
> Zayd
> --
> Posted via http://www.ruby-forum.com/.
>


 
Reply With Quote
 
 
 
 
Zayd Connor
Guest
Posts: n/a
 
      02-04-2009
Julian Leviston wrote:
> Best thing to do is build your program one step at a time. Pick one
> feature - say asking number of iterations and doing the loop, putting
> a print command to simply show that it's doing something in mock of
> the actual code for creating folders and files. Then add the next
> thing. Use irb to experiment with the classes to test things out. For
> instance, to find out how to use the file class, open irb then ask
> File what methods it responds to with File.methods, then try some out.
>
> Blog: http://random8.zenunit.com/
> Learn rails: http://sensei.zenunit.com/


Thanks!!! Im guessing I can create an array of those iterations? I see
that there are a bunch of file classes, and some carry more methods then
others, im also guessing that i would be using of. Ourse the file method
and use say require 'FileUtil' to access more methods that are not in
the File class. Please correct me if im wrong
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which Free upload site to use....which is Fast & Reliable divyaf@gmail.com Digital Photography 1 07-26-2007 09:34 PM
use pointer and not use pointer, which is faster to access data? shuisheng C++ 4 09-26-2006 08:05 AM
how to use stoi? which *.h to use? trivial beginners problem... Zahpod C Programming 4 04-21-2006 06:58 PM
Microcontrollers: which one ? which language ? which compiler ? The Jesus of Suburbia NZ Computing 2 02-11-2006 06:53 PM
Web Stats? Which to use? Which is best? Familyman HTML 3 02-09-2006 11:05 PM



Advertisments