Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: telldir usage Keywords: telldir broken on pyramid in att universe? Message-ID: <9973@smoke.BRL.MIL> Date: 3 Apr 89 20:35:38 GMT References: <76@estinc.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 29 In article <76@estinc.UUCP> fnf@estinc.UUCP (Fred Fish) writes: >Is it legal to do a telldir on an open directory, close the directory, >and then come back later to open the directory and use the telldir >value in a seekdir call to pick up where you left off? From the manual entry I provide with my public-domain implementation of the directory access routines: DESCRIPTION ... Telldir returns the current position associated with the named directory stream for later use as an argument to seekdir. Seekdir sets the position of the next readdir operation on the named directory stream. The new position reverts to the one associated with the directory stream when the telldir operation from which loc was obtained was performed. ... WARNINGS ... The value returned by telldir need not have any simple interpretation and should only be used as an argument to seekdir. Similarly, the loc argument to seekdir must be obtained from a previous telldir operation on the same directory stream. Telldir and seekdir are unreliable when used in conjunction with file systems that perform directory compaction or expansion or when the directory stream has been closed and reopened. It is best to avoid using telldir and seekdir altogether.