Interface ITcFileAccess

Interface for accessing the file system from TwinCAT C++ modules

Syntax


TCOM_DECL_INTERFACE("742A7429-DA6D-4C1D-80D8-398D8C1F1747", ITcFileAccess) __declspec(novtable) ITcFileAccess: public ITcUnknown

Required include: TcFileAccessInterfaces.h

Interface ITcFileAccess 1: Methods

Name

Description

FileOpen

Opens a file.

FileClose

Closes a file.

FileRead

Reads from a file.

FileWrite

Writes to a file.

FileSeek

Specifies the position within a file for further actions.

FileTell

Queries the currently set position within a file.

FileRename

Renames a file.

FileDelete

Deletes a file.

FileGetStatus

Gets the status of a file.

FileFindFirst

Searches for a file, first iteration.

FileFindNext

Searches for a file, next iteration.

FileFindClose

Closes a file search.

MkDir

Creates a directory.

RmDir

Deletes a directory.

The ITcFileAccess interface is used to access files in file systems.
Because the methods provided cause blockages, this interface should not be used in CycleUpdate() / real-time context. The derived interface ITcFileAccessAsync adds a Check() method that can be used instead.

See Sample20a: FileIO-Cyclic Read / Write.

The interface is implemented via the CID_TcFileAccess module class.