Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter SixFile Functions (continued)

CanAccessFile Function

Overview

The CanAccessFile function tests to see if a file can be created or accessed using an optionally specified mode.

Syntax/Parameters

Syntax

boolean = CanAccessFile ( string name, [dword mode] );

Parameters

name

A string containing a fully qualified path and filename. This parameter supports UTF encoding for filenames with Unicode characters.

mode

An dword specifying an optional access mode. The parameter can be a combination of bitwise flags. See Section 6.2 File Access Modes. If omitted, the file is created with read access exclusive.

Return Value

Returns TRUE if the file specified by name can be accessed or created or FALSE if it cannot. Use the GetLastError function to retrieve error information. The GetLastErrorMessage function may contain information to supplement the error code. Error codes match Windows system error codes (for a list, see the Appendix or MSDN).

Remarks

The CanAccessFile function first attempts to open the file with the requested mode and, if the file does not exist, attempts to create the file and subsequently deletes the file as required.

Related Functions