Getfilelist, Fclose – Argox PA-20 Programming Guide User Manual

Page 52

Advertising
background image

PT-20 Programming Guide

50

Lookup”.

Returns: -1 : path error.

-2 : disk unformat.

upward 0 : When pssBuffer = NULL, it will return buffer size. When

pssBuffer != NULL, it will return folder quantity.

fErrorCode: None

getFileList

Purpose: Get the file information in designate path.

Syntax: int getFileList(char *pssPath, char *pssBuffer);

Example call: int File_Num;

char assBuffer[200];

File_Num = getFileList(“D:\\Lookup\\”, assBuffer);

Includes:

#include “SDK.h ”

Description: The getFileList function can get the file quantity and name in designate

path.

When pssBuffer = NULL, this function will return the buffer size.

For example, the path “C:\Data\” has two files “StoreIn.dat”,

“StoreOut.dat”, and their size are 1128 bytes and 564 bytes, then the

buffe

r will get file information like “StoreIn.dat dat 1128 StoreOut.dat dat

564 “.

Returns: -1 : path error.

-2 : disk unformat.

upward 0 : When pssBuffer = NULL, it will return buffer size. When

pssBuffer != NULL, it will return file quantity.

fErrorCode: None

_fclose

Purpose: Use _fclose to close a file opened earlier for buffered input/output using

_fopen.

Syntax: int _fclose(_TFILE *file_pointer);

Example call: _fclose(infile);

Includes:

#include “SDK.h”

Description: The _fclose function closes the file specified by the argument file_pointer.

This pointer must have been one returned earlier when the file was opened

by _fopen. If the file is opened for writing, the contens of the buffer

associated with the file are flushed before the file is closed. The buffer is

then released.

Returns: If the file is successfully closed, _fclose returns a zero. In case of an error,

the return value is equal to the constant EOF.

Advertising