Xref: utzoo comp.sys.amiga:43478 comp.sys.amiga.tech:8116 Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ncar!tank!eecae!cps3xx!usenet From: usenet@cps3xx.UUCP (Usenet file owner) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Lattice 5.02 Keywords: stat + 5.04 Message-ID: <5342@cps3xx.UUCP> Date: 10 Nov 89 20:00:02 GMT References: <1989Nov8.173040.17138@cat.fulcrum.bt.co.uk> <127655@sun.Eng.Sun.COM> <5321@cps3xx.UUCP> <127700@sun.Eng.Sun.COM> Reply-To: porkka@frith.UUCP (Joe Porkka) Organization: Michigan State University Lines: 41 In article <127700@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes: >In article <5321@cps3xx.UUCP> porkka@frith.UUCP (Joe Porkka) writes: >> size=FileInfoBlock.Length; /* I think, check the includes */ > >Last time I checked the DOS ignored this value but that was some time >ago so it may have been fixed. > >--Chuck I use this in HyperHelp to find out how much memory to Alloc. I this value with debug_flags_on, and it does agree with what "list" reports. Here is working and tested (though not complete) example code: #include #include struct FileInfoBlock *fileinfo=0; struct Lock *lock=0,*Lock(); /* to get info about the disk */ long len; if( (fileinfo=(struct FileInfoBlock *)AllocMem(sizeof(struct FileInfoBlock),0))==0) { goto fail; } if( (lock=Lock(name,ACCESS_READ))==0) { goto fail; } if(0==Examine(lock,fileinfo)){ goto fail; } if(fileinfo->fib_DirEntryType>=0){ /* Is it a regular file? */ goto fail; /* Nope, must be a directory */ } len = fileinfo->fib_Size; if (fileinfo) FreeMem(fileinfo,sizeof(struct FileInfoBlock)); fileinfo=0; UnLock(lock); Joe Porkka porkka@frith.egr.msu.edu