Argox PA-20 Programming Guide Instrukcja Użytkownika Strona 53

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 130
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 52
PT-20 Programming Guide
51
_fcloseAll
Purpose
Use _fcloseAll to close all files opened for buffered input/output with _fopen
or tmpfile.
Syntax
void _fcloseAll(void);
Example call
_fcloseAll();
Includes
#include “SDK.h”
Description
The _fcloseAll function closes all files that have been opened by _fopen or
tmpfile for buffered I/O. Buffers associated with files opened for writing are
written out to the corresponding file before closing.
_filelength
Purpose
Use _filelength to dertimine the length of a file in bytes.
Syntax
size_t _filelength(_TFILE* file_pointer);
Example call
file_size = _filelength(infile);
Includes
#include “SDK.h”
Description
The _filelength function returns the size in number of bytes of the file
specified in the argument file_pointer. This pointer should be the return
value of earlier opened file by _fopen.
Returns
The integer value returned by _filelength is the size of the file in number of
bytes.
_fopen
Purpose
Use _fopen to open a file for buffered input/output operations.
Syntax
_TFILE* _fopen(const char*filename, const char *access_mode);
Example call
input_file = _fopen("c:\\data\\order.dat", "r");
Includes
#include “SDK.h”
Description
The fopen function opens the file specified in the argument filename. The
type of operations you intend to perform on the file must be given in the
argument access_mode. The following table explains the values that the
access_mode string can take:
Access
Mode String
Interpretation
r
Opens file for read operations only. The _fopen function
fails if the file does not exist.
w
Opens a new file for writing. If the file exists, its contents
are destroyed.
r+
Opens an existing file for both read and write
operations. Error is returned if file does not exist.
Przeglądanie stron 52
1 2 ... 48 49 50 51 52 53 54 55 56 57 58 ... 129 130

Komentarze do niniejszej Instrukcji

Brak uwag