Path: utzoo!attcan!uunet!mcsun!sunic!spocm2!spocm1!spodv4!lca From: lca@spodv4.UUCP (Lars H Carlsson) Newsgroups: comp.sys.amiga Subject: Re: Help needed on AmigaDos Locks Keywords: Lock,Help,AmigaDos Message-ID: <166@spodv4.UUCP> Date: 12 Jan 90 09:41:46 GMT References: <159@spodv4.UUCP> <2754@jolnet.ORPK.IL.US> Organization: Philips TDS, Stockholm, Sweden Lines: 33 In article <2754@jolnet.ORPK.IL.US>, caw@jolnet.ORPK.IL.US (Chris Wichura) writes: > Welp, if you use FILE then you have to know the structure that Lattice > keeps the AmigaDOS filehandle for the Unix file you are working on. Once > you know that you can look at the AmigaDOS filehandle struct and maybe > get the lock out of it. I forget if struct FileHandle (or whatever) is > considered private only, though... I have looked through the structures for FileHandle etc. and I can't find any connection between the FileHandle and the Lock. > A much more useful function would be a way to open a file based on the > lock you have instead of having to go though some crap like use ARP's > PathName() command to build the filename off the lock so you could feed > it to Open(). Does such a beast exist and I just haven't been able to > find it is all? What I am looking for is a way to simulate the fstat(2) system call. fstat (fd) int fd; { struct stat s; ... lock = fd -> ... or getlock(fd) Examine (lock, &b... s.st_size = b.FileSize ... ... So I really need to get the lock from filehandle (I guess??) Lars H Carlsson (..!sunic!spocm2!spodv4!lca)