🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #4758

Re: Problems with lseek() under Manx 5.0b

#4758
From: Matthew Dillon
Date: Mon, 06 Aug 1990 21:35
35 lines
1397 bytes
In article <55519@ames.arc.nasa.gov> smithwik@pioneer.arc.nasa.gov (R. Michael Smithwick -- FSN) writes:
>[]
>
>As anyone else encounted the lseek problem in Manx 5.0b and
>know of a workaround?
>
>I want to lseek back to the beginning of a file, and write some
>updated info to it. I use lseek(fd,0,0). Trouble is, write()
>begins at the end of the file, not where the lseek is supposed to be.
>
>mike
>
>					>> mike smithwick <<

    Two possible problems:

    (1) You are compiling using 16 bit ints (which is an option under 5.0
	I believe, the default is 32 bits), and did not #include <fcntl.h>,
	thus no prototype and thus the second argument is being passed as
	a short instead of a long.

    (2) You openned the file with the O_APPEND flag.  Any write() to the
	file will always append, period.

    (3) There really is a bug with Aztec.

						-Matt

--


    Matthew Dillon	    dillon@Overload.Berkeley.CA.US
    891 Regal Rd.	    uunet.uu.net!overload!dillon
    Berkeley, Ca. 94708
    USA
Technical Details
Message-ID: <dillon.5322@overload.Berkeley.CA.US>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!overload!dillon
References: <55519@ames.arc.nasa.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!overload!dillon
From: dillon@overload.Berkeley.CA.US (Matthew Dillon)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Problems with lseek() under Manx 5.0b
Message-ID: <dillon.5322@overload.Berkeley.CA.US>
Date: 6 Aug 90 21:35:30 GMT
References: <55519@ames.arc.nasa.gov>
Lines: 35