File_OpenPath()

Parent Previous Next

Syntax

File_OpenPath(ByRef PathString As Dword, pMode As Bit), Byte

Parameters

PathString — source string buffer array — a string variable is required here, since ByRef passes its address automatically

pMode — 0 - Open file

              1 - Append file    

Return value

pMode — 0

cErrOK: Success.

cErrNotFound: File not found.

cErrInUse: File number is already in use.

cErrDiskFull: Disk is full or directory wasn't found

cErrRWError: Read/write error.

pMode — 1

cErrOK: Success.

cErrNotFound: File not found.

cErrDiskFull: Disk is full or directory wasn't found

cErrInUse: File is already open and in use.

cErrRWError: Read/write error.

       

Opens a file given a full path


Opens a file given a full path (e.g. "LOGS/2026/07/DATA.CSV" or "/LOGS/2026/07/DATA.CSV"). 


Splits off the last "/"-separated segment as the filename and walks the rest via FAT_WalkPath() (same directory-parsing as File_MkPath()/File_SetPath(), but without creating missing directories - a missing directory here is an error, not something to create).


A path with no "/" at all is treated as a bare filename in the current directory (same as File_Open() directly).

Example

    Dim sTemp As String * 24        'Create string array variable

    sTemp = "home/is/here/temp.txt" 'Place some path to a file in this string variable

    File_OpenPath(sTemp,1)          'Open temp.txt ready to append data

Created with the Personal Edition of HelpNDoc: Streamline Your CHM Help File Creation with HelpNDoc