Re: fgets() equivalent?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Pops <dude@xxxxxxxxxxxxxxxxxxxxxx> wrote:

fgets() is standard in C file I/O.

The only issue you need to pay attention too, is RAW (binary) vs COOK
mode. It will relate t he EOL (end of line) definitions of MS-DOS
(<CRL><LR>) vs Unix (<LF>). Depending on your application that may or
may no pertain.

This is a handy definition, but it is NOT CORRECT. Cooked mode in a Unix
terminal program means "line at a time". The program cannot read anything
until the user has pressed Return or Enter. Raw mode means "character at a
time". Each keypress is returned to the program as soon as it is
transmitted.

The raw vs cooked distinction in Unix is VERY different from the binary vs
text distinction in MS-DOS. As others have tried to point out, raw vs
cooked mode in Unix applies ONLY to terminals. It has no meaning for text
files.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.



Relevant Pages

  • NTP vs BCD vs Unix (unsinged int or unsigned long int) time format coding: is there a sensible expl
    ... NTP vs BCD vs Unix time format ... I like [raw] Unix Time's lack of ambiguity is best suited for setting the ...
    (comp.protocols.time.ntp)
  • RE: Raw device VS cooked file - any benchmark recently done?
    ... have a number of systems that are running with acceptable performance on raw ... But from almost 20 years of working with this disk architecture and with ... But will that continue when the UNIX file system gets more ... recent advances in I/O caching for cooked writes can provide ...
    (comp.databases.informix)
  • Re: Is there a way to flush the file cache?
    ... O_DIRECT flag which causes file I/O to use user buffers instead of the ... Raw IO isn't supported in the 2.6 kernels. ...
    (comp.os.linux.misc)
  • Re: Raw device VS cooked file - any benchmark recently done?
    ... I know what pros and cons of using raw might be. ... it might be actually true that there are disk devices able to achieve "I/O ... I use Informix since years, and always have installed it making use of raw devices, since there always have been a clear statement in the IBM documentation telling that on UNIX raw devices are the suggested choice for the best I/O performance. ... recent advances in I/O caching for cooked writes can provide ...
    (comp.databases.informix)
  • Raw device VS cooked file - any benchmark recently done?
    ... I use Informix since years, and always have installed it making use of raw devices, since there always have been a clear statement in the IBM documentation telling that on UNIX raw devices are the suggested choice for the best I/O performance. ... you should use raw disk devices to store data whenever performance is important.>> ... where the cooked file is stored on a device where "I/O caching ...
    (comp.databases.informix)