File Manipulation - Argox PA-20 Programming Manual

Portable data terminal
Hide thumbs Also See for PA-20:
Table of Contents

Advertisement

__access
Purpose:
Check for file existence.
Syntax:
int __access(char *filename);
if(__access("C:\\data\\store.dat") _puts("store.dat exist!!");
Example call:
#include "SDK.h "
Includes:
Description:
Check if the file specified by filename.
Returns:
If the file specified by filename exist, access returns an integer
value of 1, 0 otherwise. In case of error, access will return an
integer value of -1 and an error code is set to the global variable
fErrorCode to indicate the error condition encountered. Possible
error codes and theirinterpretation are listed below.
fErrorCode:
1: filename is a NULL string.
append
Purpose:
Write a specified number of bytes to bottom (end-of-file position)
of a DAT file.
Syntax:
int append(int fd, char *buffer, int count);
append(fd,"ABCDE",5);
Example call:
#include "SDK.h "
Includes:
Description:
The append function writes the number of bytes specified in the
argument count from the character array buffer to the bottom of a
DAT file whose file handle is fd. Writing of data starts at the
end-of-file position of the file, and the file pointer position is
unaffected by the operation. The append function will
automatically extend the file size of the file to hold the data
written.
Returns:
The append function returns the number of bytes actually written
to the file. In case of error, append returns an integer value of -1
and an error code is set to the global variable fErrorCode to
indicate the error condition encountered. Possible error codes and
their interpretation are listed below.
fErrorCode:
2 File specified by fd does not exist.
8 File not opened
9 The value of count is negative.
10 No more free file space for file extension.
appendln
PT-20 Programming Guide

File Manipulation

37

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pa-21Pa-2110Pa-2010

Table of Contents