afCloseFile(3dm)                                              afCloseFile(3dm)


NAME
     afCloseFile - close an audio file, update file header if file was opened
     for write access.

SYNOPSIS
     #include <dmedia/audiofile.h>

     int afCloseFile(AFfilehandle file)

PARAMETER
     file   is the AFfilehandle structure for the audio file you want to
            close.  This structure is the returned value of the
            afOpenFile(3dm) call.

RETURN VALUE
     afCloseFile() returns 0 if file is closed without error.  If an error
     occurs while closing file or updating the file header fields, it returns
     -1.

DESCRIPTION
     afCloseFile() releases file's resources back to the system.  This routine
     also takes care of updating the header information for files which were
     opened for write access.  Since file will be deallocated, file's value
     should not be used in any subsequent Audiofile Library procedure calls.

CAVEATS
     Note that afCloseFile() will close the file descriptor associated with
     file whether it was opened with afOpenFile(3dm) or afOpenFD(3dm).  This
     is unfortunately not consistent with the SGI Movie Library, but must be
     maintained for backwards compatibility.

     This routine will not function correctly if the user changes the file
     position on the file descriptor for the AFfilehandle being manipulated.
     See the section CAVEATS FOR USING THE HANDLE'S FILE DESCRIPTOR in
     afIntro(3dm) for important information about how to deal with this
     situation.

SEE ALSO
     afSyncFile(3dm), afOpenFile(3dm), afNewFileSetup(3dm),
     afFreeFileSetup(3dm)


                                                                        Page 1