Re: [Flightgear-devel] SGFile::readline

2010-03-02 Thread John Denker
On 03/02/2010 01:08 AM, Tim Moore wrote: Furthermore, I can't parse the suspend development comment. It is coming from some alternate reality of git usage. We are definitely talking about two different realities. First off, I did identify the commit id where you made changes to use

Re: [Flightgear-devel] SGFile::readline

2010-03-01 Thread John Denker
On 03/01/2010 04:13 PM, Tim Moore wrote: I'm looking at io/sg_file.cxx in the sport branch. I see the old implementation of readline inside an execrable_readline #ifdef. I don't see any other implementation of readline. Perhaps my question would go away if I fetched your sport flightgear

Re: [Flightgear-devel] SGFile::readline

2010-02-23 Thread John Denker
On 02/15/2010 03:19 AM, Tim Moore in part wrote: readline() is pretty gross; The best way to remove the grossness is to extirpate readline and replace it with something that has a nicer interface ... such as returning a std::string. I wrote a getline function to do this. Much cleaner. No

Re: [Flightgear-devel] SGFile::readline

2010-02-23 Thread Tim Moore
On Tue, Feb 23, 2010 at 11:36 PM, John Denker j...@av8n.com wrote: I tried asking for suggestions and/or review off-list, but it appears that mail to timoor...@gmail.com never goes through. Is it a list-mail address only? No. Sometimes I'm busier and/or lamer than other times. I did get

Re: [Flightgear-devel] SGFile::readline

2010-02-17 Thread John Denker
On Mon, Feb 15, 2010 at 5:43 PM, I wrote: 2) It would be even less of a problem to do the following the specified number of times: -- detect the EoF -- close the file -- reopen the file and start reading again. This has the advantage that it works the same as lseek for regular disk

Re: [Flightgear-devel] SGFile::readline

2010-02-17 Thread Tim Moore
Thanks John, I'll check this out. Tim On Wed, Feb 17, 2010 at 4:09 PM, John Denker j...@av8n.com wrote: On Mon, Feb 15, 2010 at 5:43 PM, I wrote: 2) It would be even less of a problem to do the following the specified number of times: -- detect the EoF -- close the file -- reopen

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread Tim Moore
On Sun, Feb 14, 2010 at 10:47 PM, John Denker j...@av8n.com wrote: The following commit message should be self-explanatory: commit 224ce694fa8ba7dede0e413b81e5dd52e5e65f15 Author: John Denker j...@av8n.com Date: Thu Feb 11 21:13:19 2010 -0700 Problem was: readline writes

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread John Denker
On 02/15/2010 03:19 AM, Tim Moore wrote: Some of the grossness is due to a hack which lets a file be treated as an infinitely repeating stream of bytes, very convenient for demos at SIGGRAPH. Your patch breaks that hack. I won't argue too strongly that the hack belongs in SGFile, but I want

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread John Denker
On 02/15/2010 09:22 AM, Tim Moore wrote: Hint: The sleep statement ensures that the reader (fgfs) will not see an EoF at the point where one cat of bytes ends and the next begins. I'd probably do without the sleep and write while true; do cat bytes; done /tmp/pipe.flog instead. 1) That

Re: [Flightgear-devel] SGFile::readline

2010-02-15 Thread Tim Moore
On Mon, Feb 15, 2010 at 5:43 PM, John Denker j...@av8n.com wrote: On 02/15/2010 09:22 AM, Tim Moore wrote: Hint: The sleep statement ensures that the reader (fgfs) will not see an EoF at the point where one cat of bytes ends and the next begins. I'd probably do without the sleep and

[Flightgear-devel] SGFile::readline

2010-02-14 Thread John Denker
The following commit message should be self-explanatory: commit 224ce694fa8ba7dede0e413b81e5dd52e5e65f15 Author: John Denker j...@av8n.com Date: Thu Feb 11 21:13:19 2010 -0700 Problem was: readline writes out-of-bounds, corrupts memory. Problem was: readline seeks on files that don't