a question on open() and lseek()

tim at ism780c.UUCP tim at ism780c.UUCP
Thu Apr 24 06:14:47 AEST 1986


In article <691 at edison.UUCP> jso at edison.UUCP (John Owens) writes:
>>      Is there any reason to use the sequence:
>> 		f = open( file, O_WRONLY );
>> 		lseek( f, 0, L_XTND );
>> 	instead of the single call:
>> 		f = open( file, O_WRONLY | O_APPEND );
>
>Because many versions of UNIX do not support the O_APPEND flag; it's
>a fairly recent innovation.  All versions since v7 (at least that I'm
>aware of) should support the open/lseek method.

How about doing both?  Unixes that do not recognize O_APPEND will probably
ignore it, and unixes that do will ignore the lseek.


-- 
Tim Smith       sdcrdcf!ism780c!tim || ima!ism780!tim || ihnp4!cithep!tim



More information about the Comp.unix.wizards mailing list