Julian Elischer wrote: > Oliver Fromme wrote: > > Julian Elischer wrote: > > > [...] > > > What is the effective maximum line length for a single fgetln? > > > > It's unlimited. fgetln() allocates sufficient amount of > > memory dynamically, that's why I used it instead of fgets(). > > It avoids reinventing the wheel. > > NOTHING is unlimitted. I didn't think that I realy have to mention this explicitly, but ... Of course it is limited by the total amount of available memory (RAM + swap), and of course it is subject to process resource limits (maxdsize etc.). > what happens with a 3GB sequence of characters with no newlines? If you have a sufficient amount of memory and process recource limits, it will work just fine. Otherwise it will break out of the loop. Admittedly it should print an error message in that case (easy to add). A 3GB sequence of characters with no newline should be quite uncommon. I think the syslog protocol even has a limit of 1024 characters per line, I think. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. Perl is worse than Python because people wanted it worse. -- Larry WallReceived on Mon Sep 04 2006 - 08:54:32 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:59 UTC