Metrologic Optimus S Programming Manual page 192

"c" programming guide
Table of Contents

Advertisement

186
"C" Programming Guide For Optimus S/R
filelist
read_error_code
remove
On error, it returns -1.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Error Code
1
Purpose
To get the file directory information.
int filelist (char *dir);
Syntax
char *dir;
Example
total_file = filelist (dir);
This routine copies the file name, file type, and file size information (separated
Description
by a blank character) of all files in existence into a character array specified by
the argument dir.
Return
It simply returns the number of files currently exist in the system.
Purpose
To get the value of the global variable fErrorCode.
int read_error_code (void);
Syntax
Example
if (read_error_code() == 2) puts ("File not exist!\n");
Description
This routine gets the value of the global variable fErrorCode and returns the
value to the calling program. User can call this function to get the error code of
the previously called routine for file manipulation.
Yet, the global variable fErrorCode can be directly accessed without making a
call to this routine.
Return
It returns the value of the global variable fErrorCode.
Purpose
To delete a file.
Syntax
int remove (char *filename);
char *filename;
Example
if (remove ("data1")) puts ("data1 is deleted!\n");
Description
This routine deletes the file specified by the argument filename.
If the filename exceeds eight characters, it will be truncated to eight
characters.
Interpretation
filename is a NULL string.
/* pointer to a buffer where the information is copied to */
/* name of the file to be deleted */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents