Ask a Question related to Ruby, Design and Development.

  1. #1

    Default updating a File

    --0-981226360-1068980951=:16169
    Content-Type: text/plain; charset=us-ascii

    Hi,

    Could anyone please tell me how can I write to a file which already contains some data without erasing any previous data?

    Afan.


    ---------------------------------
    Do you Yahoo!?
    Protect your identity with Yahoo! Mail AddressGuard
    --0-981226360-1068980951=:16169--

    Afan Shah Guest

  2. Similar Questions and Discussions

    1. Updating an XML file with Flash
      Hi, I have just been going trough the sample application "Bike Trips Sample" Using the XMLConnector Component to upload and navigate an xml file....
    2. Updating DB from a csv file
      Most text data files have one record per line. You are looping through the file as a list and specifying the vertical tab character as a delimiter...
    3. Updating XML file using components
      I am making a simple contact list application using XML. I am trying to achieve this as little coding as possible, using components. I am using the...
    4. Updating a text file
      R. Joseph Newton wrote: >Jan Eden wrote: > >>Hi, >> >>net wrote: >> >>>I have a text file with a records like: >>>
    5. updating dataset from xml file
      Hello, I am new in developing with Dataset, XML, Web Services ... I want to load a xml file into a dataset and update the database with new and...
  3. #2

    Default Re: updating a File

    >>>>> "A" == Afan Shah <afan_shah@yahoo.com> writes:

    A> Could anyone please tell me how can I write to a file which already
    A> contains some data without erasing any previous data?

    open it with "a", for example

    svg% cat aa
    a
    svg%

    svg% ruby -e 'File.open("aa", "a") {|f| f.puts "b"}'
    svg%

    svg% cat aa
    a
    b
    svg%



    Guy Decoux

    ts Guest

Posting Permissions

  • You may not post new threads
  • You may 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