C Notebook
by Lee Calcraft

Running this application opens a directory viewer containing a text file, CFuncs2-1, which consists of a number of C functions concerned with obtaining information on a given file. Listing 1 details the function flib_fileinfo, which for a specified object gives the filetype, length and whether the object is a file, directory or non-existent. Listing 2 demonstrates how this function could be called from within a program.

Note: The main function can be used to test flib_fileinfo(), but note that the program must be run with Wimp_StartTask (e.g. from an Edit Task window) as the function reports errors using the Wimp.

The functions are described in detail in this month's magazine (RISC User Volume 4 Issue 7 page 57).
