Which File Classto use

Discussion in 'Ruby' started by Zayd Connor, Feb 3, 2009.

  1. Zayd Connor

    Zayd Connor Guest

    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/.
     
    Zayd Connor, Feb 3, 2009
    #1
    1. Advertising

  2. 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 <> 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/.
    >
     
    Julian Leviston, Feb 4, 2009
    #2
    1. Advertising

  3. Zayd Connor

    Zayd Connor Guest

    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/.
     
    Zayd Connor, Feb 4, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Familyman
    Replies:
    3
    Views:
    529
    Alan J. Flavell
    Feb 9, 2006
  2. Darth Tyrannus

    File I/O....which class to use?

    Darth Tyrannus, Sep 27, 2006, in forum: Java
    Replies:
    4
    Views:
    1,045
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Sep 30, 2006
  3. Replies:
    0
    Views:
    723
  4. Zahpod
    Replies:
    4
    Views:
    683
    Zahpod
    Apr 21, 2006
  5. shuisheng
    Replies:
    4
    Views:
    373
    peter koch
    Sep 26, 2006
Loading...

Share This Page