[comp.sys.amiga.tech] Common disk functions in C

netnews@uafhp.uark.edu (Netnews) (12/08/90)

From: bbs00068@uafcseg.uucp (Joel Kolstad)
Path: uafcseg!bbs00068
Organization: College of Engineering, University of Arkansas, Fayetteville


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 to AmigaDOS functions that do things like "ChDir()" "FindFirst()"
"FindNext()" and so one like I use on the MessyDOS machines at work.  

I currently only have the RKM: Libraries and Devices manual -- so does Includes
& AutoDocs have something to say about this?  Or what else do I need?

(This is all under Aztec C 5.0d, in case it matters...)

You can send me replies at kolstad@cae.wisc.edu, or, if you think someone besides me cares, post a reply.  (Yes, I _DO_ read this group! :-) ).

Again, thanks for any help.

						---Joel Kolstad
						kolstad@cae.wisc.edu

markv@kuhub.cc.ukans.edu (12/11/90)

> 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~