Professional Web Applications Themes

How to delete a directory? - Ruby

Hi all, I've read through the Pickaxe doentation, and the output from 'ri'. I want to delete a directory, but I honestly can't figure out how. The File class doesn't seem to have a method for this. Any ideas? Cheers, -- Daniel Carrera | OpenPGP KeyID: 9AF77A88 PhD grad student. | Mathematics Dept. | "To understand recursion, you must first UMD, College Park | understand recursion"....

  1. #1

    Default How to delete a directory?

    Hi all,

    I've read through the Pickaxe doentation, and the output from 'ri'. I
    want to delete a directory, but I honestly can't figure out how. The File
    class doesn't seem to have a method for this.

    Any ideas?

    Cheers,
    --
    Daniel Carrera | OpenPGP KeyID: 9AF77A88
    PhD grad student. |
    Mathematics Dept. | "To understand recursion, you must first
    UMD, College Park | understand recursion".

    Daniel Carrera Guest

  2. #2

    Default Re: How to delete a directory?

    * Daniel Carrera (dcarreramath.umd.edu) wrote:
    > Hi all,
    >
    > I've read through the Pickaxe doentation, and the output from 'ri'. I
    > want to delete a directory, but I honestly can't figure out how. The File
    > class doesn't seem to have a method for this.
    emielmarvin:/usr/lib/ruby/1.8> ri Dir.delete
    ------------------------------------------------------------ Dir::delete
    Dir.delete( aString ) -> 0
    ------------------------------------------------------------------------
    Deletes the named directory. Raises a subclass of SystemCallError
    if the directory isn't empty.

    If you are using Ruby 1.8 you should check out 'FileUtils'. It allows
    you to do recursive deletes among other things.

    Emiel
    --
    E F van de Laar
    [url]www.il.fontys.nl/~emiel[/url]

    E F van de Laar Guest

Similar Threads

  1. How to delete a whole directory in Contribute CS3
    By wati555 in forum Macromedia Contribute Connection Administrtion
    Replies: 2
    Last Post: October 18th, 08:37 AM
  2. delete directory files from a list. Help Please
    By Michael Budash in forum PERL Miscellaneous
    Replies: 5
    Last Post: July 26th, 03:28 AM
  3. Cannot delete a directory, please help
    By Chalawal Maliwan in forum SCO
    Replies: 2
    Last Post: July 9th, 01:16 PM
  4. how to delete directory named "this..."?
    By james in forum Windows Setup, Administration & Security
    Replies: 2
    Last Post: July 2nd, 02:26 AM
  5. How to delete directory named "This..."
    By james in forum Windows XP/2000/ME
    Replies: 1
    Last Post: July 1st, 02:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139