AMCAF Extension V1.40 Manual  Index

Disk Object Commands


The AMOS functions Dir First$ and Dir Next$ are neither very reliable nor very easy to use.
Using these commands you could only get the name and the length of the object but what could you do if you wanted to know even more?
Thankfully, AMCAF provides you with an easy solution for these problems.


Commands

EXAMINE OBJECT
instruction: get all information about an object
Examine Object file$

Examine Object supplies you with all available information about the object named 'file$'.
This data can then be requested using the Object functions without any parameters.


EXAMINE DIR
instruction: initialise the reading of a drawer
Examine Dir directory$

This command loads all information about the drawer 'directory$' into the FileInfoBlock.
Additionally, the contents of the directory can be read out by Examine Next$.


EXAMINE STOP
instruction: stop the reading of a directory
Examine Stop

Aborts the reading process of a directory. After this command, you may not make any further calls to Examine Next$.


Functions

EXAMINE NEXT$
function: read the next entry in a directory
file$=Examine Next$

Gets information about the next object in the directory and returns its name.
More information can be acquired using the object functions. If the end of the directory list is reached, 'file$' will contain an empty string and the drawer will be closed.


OBJECT NAME$
function: return the name of an object
file$=Object Name$
file$=Object Name$(pathfile$)

Object Name$ returns the name of the object 'pathfile$'. This function is similar to the Filename$-Function, but acts quite differently as the existence of the file is checked.
More information about the object is stored in the info block and the name is read out with correct case.
The first version of Object Name$ gets the name of the object from the info block which has been read out earlier using Examine Object.


OBJECT TYPE
function: return the type of an object
type=Object Type
type=Object Type(pathfile$)

This functions finds out if 'pathfile$' or the object whose data is currently in the info block is a directory or a file.
'type' is greater than 0 for a file, less than 0 if the object is a drawer.


OBJECT SIZE
function: return the length of a file
length=Object Size
length=Object Size(pathfile$)

This function returns the size of an object. The first version copies the size directly from the current info block.
The second version fills the info block with other data of the object 'pathfile$'.


OBJECT BLOCKS
function: return the length of a file in blocks
number=Object Blocks
number=Object Blocks(pathfile$)

Object Blocks returns the number of blocks the current or the object 'pathfile$' uses on a specific volume.


OBJECT PROTECTION
function: return the protection flags of an object
prot=Object Protection
prot=Object Protection(pathfile$)

Object Protection returns the Protection flags of an object.
The Object Protection$ function converts this numeric value into a string in the format "hsparwed".


OBJECT TIME
function: return the time of creation of an object
time=Object Time
time=Object Time(pathfile$)

Object Time returns the time of the last write access to an object.
The value 'time' can be converted into hours, minutes, seconds and ticks using the time functions.


OBJECT DATE
function: return the date of creation of an object
date=Object Date
date=Object Date(pathfile$)

Object Date returns the date stamp of an object as numeric value. This can also be separated into year, month, day and weekday using the date functions.


OBJECT COMMENT$
function: return the file note of an object
comment$=Object Comment$
comment$=Object Comment$(pathfile$)

This function returns the file note of an object.