🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Random Access Files in C

#4816
From: Joe Smith
Date: Fri, 10 Aug 1990 04:35
14 lines
1281 bytes
In article <32425@cup.portal.com> Peter_Warren_Lee@cup.portal.com writes:
>I saw some file functions that appeared to be used for writing sequential
>files but I didn't see anything that would handle random access files. Is
>there a good way to do it in C?

Check your manals for the lseek() function.  You can do your own random I/O
by putting an lseek in front of every write.  Since AmigaDOS (like Unix)
treats all files a sequential streams of bytes, you'll have to calculate
suitable values for lseek yourself.
-- 
Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41    | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."
Technical Details
Message-ID: <1174@tardis.Tymnet.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!apple!olivea!oliveb!tymix!tardis!jms
References: <32425@cup.portal.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!apple!olivea!oliveb!tymix!tardis!jms
From: jms@tardis.Tymnet.COM (Joe Smith)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Random Access Files in C
Summary: Use lseek()
Message-ID: <1174@tardis.Tymnet.COM>
Date: 10 Aug 90 04:35:10 GMT
References: <32425@cup.portal.com>
Reply-To: jms@tardis.Tymnet.COM (Joe Smith)
Organization: BT Tymnet, San Jose, CA
Lines: 14