Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #4210
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!news.stack.nl!talisker.lacave.net!lacave.net!not-for-mail |
|---|---|
| From | 7stud -- <bbxx789_05ss@yahoo.com> |
| Newsgroups | comp.lang.ruby |
| Subject | Re: gsub and multiple-replacement |
| Date | Tue, 10 May 2011 16:25:11 -0500 |
| Organization | Service de news de lacave.net |
| Lines | 20 |
| Message-ID | <c6da27b88a381128e0c603bd0fb1c642@ruby-forum.com> (permalink) |
| References | <eb286679b6d688c796525a6786d4394f@ruby-forum.com> |
| NNTP-Posting-Host | bristol.highgroove.com |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | talisker.lacave.net 1305062741 92108 65.111.164.187 (10 May 2011 21:25:41 GMT) |
| X-Complaints-To | abuse@lacave.net |
| NNTP-Posting-Date | Tue, 10 May 2011 21:25:41 +0000 (UTC) |
| In-Reply-To | <eb286679b6d688c796525a6786d4394f@ruby-forum.com> |
| X-Received-From | This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway |
| X-Mail-Count | 382920 |
| X-Ml-Name | ruby-talk |
| X-Rubymirror | Yes |
| X-Ruby-Talk | <c6da27b88a381128e0c603bd0fb1c642@ruby-forum.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.ruby:4210 |
Show key headers only | View raw
> Here are a few caveats: > I don't need a temp file. Yes, you do. > I am unconcerned with overwriting the username.txt file with itself. Ok, you still need a tempfile. Now, if you say you are unconcerned with losing all the data in your file, then you don't need a tempfile. The bottom line is this: you don't replace anything in a file. Instead, you read in the original file, and write out the altered lines to a new file. When you are done, you can delete the original file and rename the new file to the old file name. -- Posted via http://www.ruby-forum.com/.
Back to comp.lang.ruby | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
gsub and multiple-replacement Greg Hacke <greghacke@gmail.com> - 2011-05-10 16:16 -0500
Re: gsub and multiple-replacement 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-10 16:25 -0500
Re: gsub and multiple-replacement 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-10 16:43 -0500
Re: gsub and multiple-replacement Greg Hacke <greghacke@gmail.com> - 2011-05-10 19:49 -0500
Re: gsub and multiple-replacement 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-10 21:07 -0500
Re: gsub and multiple-replacement Jesús Gabriel y Galán <jgabrielygalan@gmail.com> - 2011-05-11 03:00 -0500
Re: gsub and multiple-replacement Phillip Gawlowski <cmdjackryan@googlemail.com> - 2011-05-10 16:28 -0500
Re: gsub and multiple-replacement Greg Hacke <greghacke@gmail.com> - 2011-05-11 08:45 -0500
Re: gsub and multiple-replacement Jesús Gabriel y Galán <jgabrielygalan@gmail.com> - 2011-05-11 10:01 -0500
Re: gsub and multiple-replacement 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-11 18:31 -0500
Re: gsub and multiple-replacement 7stud -- <bbxx789_05ss@yahoo.com> - 2011-05-11 18:59 -0500
csiph-web