Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.tech Subject: Re: Common disk functions in C Message-ID: <27367.276371a4@kuhub.cc.ukans.edu> Date: 10 Dec 90 17:29:40 GMT References: <5662@uafhp.uark.edu> Organization: University of Kansas Academic Computing Services Lines: 55 > I just got a hard drive for my A-500, and it's time to start doing some > serious programming. (Lots of RAM and VD0: was OK, but this is even better!) >Anyway, one of the things I want to do is play around with files -- look at >them, do dir searches, whatever. However, I don't know of (nor did I find) >any reference toAmigaDOS functions that do things like "ChDir()" "FindFirst()" > "FindNext()" and so one like I use on the MessyDOS machines at work. These functions are documented in the "Amiga DOS Developer's Manual" which is part of the 1.2 AmigaDOS manual (by Bantam). The directory functions under DOS are... Lock() - Return a "lock" on an item. (A lock is like a file handle for manipulating the directory entry and file as a whole (Lock is faster than Open() and uses less RAM). DupLock() - Return a 2nd lock that is a copy of the first Lock(). CurrentDir() - Make the dir for the lock the current dir. UnLock() - free a lock from Lock(), Unlock(), and some others. ParentDir() - take old lock and return new lock that is parent dir. Examine() - return a FileInfoBlock for an lock. ExNext() - return a FileInfoBlock for the next item in the Locked dir. Those are the basics. There are more functions and details on when to unlock etc, in the manual. The data structures and constants used are described in libraries/dos.h and libraries/dosextens.h. >I currently only have theRKM: Libraries and Devices manual -- so does Includes > & AutoDocs have something to say about this? Or what else do I need? You need the DOS manual. > (This is all under Aztec C 5.0d, in case it matters...) > > Again, thanks for any help. Just a quickie. I can give more details direct email if you want. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark Gooderum /\ \ | / H a p p y Academic Computing Services / v\ -- * -- H o l i d a y s ! :-) University of Kansas /v v\ / | \ /// /__v___\ Only /// /| __ _ Bitnet: MARKV@UKANVAX || \\\ /// /__| |\/| | | _ /_\ makes it Internet: markv@kuhub.cc.ukans.edu \/\/ / | | | | |__| / \ possible ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~