Other File Reference Functions

Other File Reference Functions — Miscellaneous functions for file references

Functions

Includes

#include <libchimara/glk.h>

Description

This section includes functions for file references that don't fit anywhere else.

Functions

glk_fileref_destroy ()

void
glk_fileref_destroy (frefid_t fref);

Destroys a fileref which you have created. This does not affect the disk file; it just reclaims the resources allocated by the glk_fileref_create... function.

It is legal to destroy a fileref after opening a file with it (while the file is still open.) The fileref is only used for the opening operation, not for accessing the file stream.

Parameters

fref

Fileref to destroy.

 

glk_fileref_iterate ()

frefid_t
glk_fileref_iterate (frefid_t fref,
                     glui32 *rockptr);

Iterates through all the existing filerefs. See Iterating Through Opaque Objects.

Parameters

fref

A file reference, or NULL.

 

rockptr

Return location for the next fileref's rock, or NULL.

 

Returns

the next file reference, or NULL if there are no more.


glk_fileref_get_rock ()

glui32
glk_fileref_get_rock (frefid_t fref);

Retrieves the file reference fref 's rock value. See Rocks.

Parameters

fref

A file reference.

 

Returns

A rock value.


glk_fileref_delete_file ()

void
glk_fileref_delete_file (frefid_t fref);

Deletes the file referred to by fref . It does not destroy fref itself.

You should only call this with a fileref that refers to an existing file.

Parameters

fref

A refrence to the file to delete.

 

glk_fileref_does_file_exist ()

glui32
glk_fileref_does_file_exist (frefid_t fref);

Checks whether the file referred to by fref exists.

Parameters

fref

A fileref to check.

 

Returns

TRUE (1) if fref refers to an existing file, and FALSE (0) if not.