Classes 2

Class Description
DirectoryListing

A DirectoryListing iterates over the contents of a directory. To obtain a DirectoryListing handle, call OpenDirectory().

File

A File object can be obtained by calling OpenFile(). File objects should be closed with delete or Close(). Note that, "delete file" does not actually delete the file, it just closes the handle.

Enums 3

Enum Description
FileTimeMode

File time modes.

FileType

File inode types.

PathType

Path types.

Functions 27

Function Description
BuildPath

Builds a path relative to the SourceMod folder. This should be used instead of directly referencing addons/sourcemod, in case users change the name of their folder layout.

CreateDirectory

Creates a directory.

DeleteFile

Deletes a file.

DirExists

Checks if a directory exists.

FileExists

Checks if a file exists.

FilePosition

Get current position in the file.

FileSeek

Sets the file position indicator.

FileSize

Get the file size in bytes.

FlushFile

Flushes a file's buffered output; any buffered output is immediately written to the file.

GetFileTime

Returns a file timestamp as a unix timestamp.

IsEndOfFile

Tests if the end of file has been reached.

LogToOpenFile

Same as LogToFile(), except uses an open file Handle. The file must be opened in text appending mode.

LogToOpenFileEx

Same as LogToFileEx(), except uses an open file Handle. The file must be opened in text appending mode.

OpenDirectory

Opens a directory/folder for contents enumeration.

OpenFile

Opens or creates a file, returning a File handle on success. File handles should be closed with delete or CloseHandle().

ReadDirEntry

Reads the current directory entry as a local filename, then moves to the next file.

ReadFile

Reads binary data from a file.

ReadFileCell

Reads a single binary cell from a file.

ReadFileLine

Reads a line from a text file.

ReadFileString

Reads a UTF8 or ANSI string from a file.

RemoveDir

Removes a directory.

RenameFile

Renames a file.

SetFilePermissions

Changes a file or directories permissions.

WriteFile

Writes binary data to a file.

WriteFileCell

Writes a single binary cell to a file.

WriteFileLine

Writes a line of text to a text file. A newline is automatically appended.

WriteFileString

Writes a binary string to a file.