IPlatformFile

File I/O Interface

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformFile.h

Include

#include "GenericPlatform/GenericPlatformFile.h"

Syntax

class IPlatformFile

Remarks

File I/O Interface

Destructors

Name Description

Public function Virtual

~IPlatformFile()

Destructor.

Functions

Name Description

Public function Virtual

void

 

AddLocalDirectories

(
    TArray< FString >& LocalDirectorie...
)

Identifies any platform specific paths that are guaranteed to be local (i.e. cache, scratch space)

Public function Virtual

void

 

BypassSecurity

(
    bool bInBypass
)

Public function Virtual

FString

 

ConvertToAbsolutePathForExternalAppForRead

(
    const TCHAR* Filename
)

Converts passed in filename to use an absolute path (for reading).

Public function Virtual

FString

 

ConvertToAbsolutePathForExternalAppForWrite

(
    const TCHAR* Filename
)

Converts passed in filename to use an absolute path (for writing)

Public function Virtual

bool

 

CopyDirectoryTree

(
    const TCHAR* DestinationDirect...,
    const TCHAR* Source,
    bool bOverwriteAllExisting
)

Copy a file or a hierarchy of files (directory).

Public function Virtual

bool

 

CopyFile

(
    const TCHAR* To,
    const TCHAR* From,
    EPlatformFileRead ReadFlags,
    EPlatformFileWrite WriteFlags
)

Copy a file. This will fail if the destination file already exists.

Public function

bool

 

CreateDirectory

(
    const TCHAR* Directory
)

Create a directory and return true if the directory was created or already existed.

Public function Virtual

bool

 

CreateDirectoryTree

(
    const TCHAR* Directory
)

Create a directory, including any parent directories and return true if the directory was created or already existed.

Public function

bool

 

DeleteDirectory

(
    const TCHAR* Directory
)

Delete a directory and return true if the directory was deleted or otherwise does not exist.

Public function Virtual

bool

 

DeleteDirectoryRecursively

(
    const TCHAR* Directory
)

Delete all files and subdirectories in a directory, then delete the directory itself

Public function

bool

 

DeleteFile

(
    const TCHAR* Filename
)

Delete a file and return true if the file exists. Will not delete read only files.

Public function

bool

 

DirectoryExists

(
    const TCHAR* Directory
)

Return true if the directory exists.

Public function Virtual

bool

 

DoesCreatePublicFiles()

Checks to see if this file system creates publicly accessible files

Public function

bool

 

FileExists

(
    const TCHAR* Filename
)

Return true if the file exists.

Public function

int64

 

FileSize

(
    const TCHAR* Filename
)

Return the size of the file, or -1 if it doesn't exist.

Public function Virtual

void

 

FindFiles

(
    TArray< FString >& FoundFiles,
    const TCHAR* Directory,
    const TCHAR* FileExtension
)

Finds all the files within the given directory, with optional file extension filter

Public function Virtual

void

 

FindFilesRecursively

(
    TArray< FString >& FoundFiles,
    const TCHAR* Directory,
    const TCHAR* FileExtension
)

Finds all the files within the directory tree, with optional file extension filter

Public function

FDateTime

 

GetAccessTimeStamp

(
    const TCHAR* Filename
)

Return the last access time of a file.

Public function

FString

 

GetFilenameOnDisk

(
    const TCHAR* Filename
)

For case insensitive filesystems, returns the full path of the file with the same case as in the filesystem

Public function

IPlatformFil...

 

GetLowerLevel()

Gets the platform file wrapped by this file.

Public function Const

const TCHAR ...

 

GetName()

Gets this platform file type name.

Public function Static

const TCHAR ...

 

GetPhysicalTypeName()

Returns the name of the physical platform file type.

Public function Static

IPlatformFil...

 

GetPlatformPhysical()

Physical file system of the platform, never wrapped.

Public function

FFileStatDat...

 

GetStatData

(
    const TCHAR* FilenameOrDirecto...
)

Return the stat data for the given file or directory.

Public function

FDateTime

 

GetTimeStamp

(
    const TCHAR* Filename
)

Return the modification time of a file.

Public function Virtual

FDateTime

 

GetTimeStampLocal

(
    const TCHAR* Filename
)

Return the modification time of a file in the local time of the calling code (GetTimeStamp returns UTC).

Public function Virtual

void

 

GetTimeStampPair

(
    const TCHAR* PathA,
    const TCHAR* PathB,
    FDateTime& OutTimeStampA,
    FDateTime& OutTimeStampB
)

Public function

bool

 

Initialize

(
    IPlatformFile* Inner,
    const TCHAR* CmdLine
)

Initializes platform file.

Public function Virtual

void

 

InitializeAfterSetActive()

Performs initialization of the platform file after it has become the active (FPlatformFileManager.GetPlatformFile() will return this

Public function Virtual

void

 

InitializeNewAsyncIO()

Performs initialization of the platform file after the new async IO has been enabled

Public function

bool

 

IsReadOnly

(
    const TCHAR* Filename
)

Return true if the file is read only.

Public function Virtual Const

bool

 

IsSandboxEnabled()

Returns whether the sandbox is enabled or not

Public function Virtual

bool

 

IterateDirectory

(
    const TCHAR* Directory,
    FDirectoryVisitorFunc Visitor
)

Call the visitor once for each file or directory in a single directory.

Public function

bool

 

IterateDirectory

(
    const TCHAR* Directory,
    FDirectoryVisitor& Visitor
)

Call the Visit function of the visitor once for each file or directory in a single directory.

Public function Virtual

bool

 

IterateDirectoryRecursively

(
    const TCHAR* Directory,
    FDirectoryVisitorFunc Visitor
)

Call the Visit function of the visitor once for each file or directory in a directory tree.

Public function Virtual

bool

 

IterateDirectoryRecursively

(
    const TCHAR* Directory,
    FDirectoryVisitor& Visitor
)

Call the Visit function of the visitor once for each file or directory in a directory tree.

Public function Virtual

bool

 

IterateDirectoryStat

(
    const TCHAR* Directory,
    FDirectoryStatVisitorFunc Visitor
)

Call the visitor once for each file or directory in a single directory.

Public function

bool

 

IterateDirectoryStat

(
    const TCHAR* Directory,
    FDirectoryStatVisitor& Visitor
)

Call the Visit function of the visitor once for each file or directory in a single directory.

Public function Virtual

bool

 

IterateDirectoryStatRecursively

(
    const TCHAR* Directory,
    FDirectoryStatVisitor& Visitor
)

Call the Visit function of the visitor once for each file or directory in a directory tree.

Public function Virtual

bool

 

IterateDirectoryStatRecursively

(
    const TCHAR* Directory,
    FDirectoryStatVisitorFunc Visitor
)

Call the Visit function of the visitor once for each file or directory in a directory tree.

Public function

bool

 

MoveFile

(
    const TCHAR* To,
    const TCHAR* From
)

Attempt to move a file. Return true if successful. Will not overwrite existing files.

Public function Virtual

IAsyncReadFi...

 

OpenAsyncRead

(
    const TCHAR* Filename
)

Open a file for async reading. This call does not hit the disk or block.

Public function Virtual

IMappedFileH...

 

OpenMapped

(
    const TCHAR* Filename
)

Open a file for async reading. This call does hit the disk; it is synchronous open.

Public function

IFileHandle ...

 

OpenRead

(
    const TCHAR* Filename,
    bool bAllowWrite
)

Attempt to open a file for reading.

Public function Virtual

IFileHandle ...

 

OpenReadNoBuffering

(
    const TCHAR* Filename,
    bool bAllowWrite
)

Public function

IFileHandle ...

 

OpenWrite

(
    const TCHAR* Filename,
    bool bAppend,
    bool bAllowRead
)

Attempt to open a file for writing.

Public function Virtual

bool

 

SendMessageToServer

(
    const TCHAR* Message,
    IFileServerMessageHandler* Han...
)

Sends a message to the file server, and will block until it's complete.

Public function Virtual

void

 

SetAsyncMinimumPriority

(
    EAsyncIOPriorityAndFlags MinPriorit...
)

Controls if the pak precacher should process precache requests.

Public function Virtual

void

 

SetCreatePublicFiles

(
    bool bCreatePublicFiles
)

Sets file system to create publicly accessible files or not

Public function

void

 

SetLowerLevel

(
    IPlatformFile* NewLowerLevel
)

Sets the platform file wrapped by this file.

Public function

bool

 

SetReadOnly

(
    const TCHAR* Filename,
    bool bNewReadOnlyValue
)

Attempt to change the read only status of a file. Return true if successful.

Public function Virtual

void

 

SetSandboxEnabled

(
    bool bInEnabled
)

Set whether the sandbox is enabled or not

Public function

void

 

SetTimeStamp

(
    const TCHAR* Filename,
    FDateTime DateTime
)

Sets the modification time of a file

Public function Virtual Const

bool

 

ShouldBeUsed

(
    IPlatformFile* Inner,
    const TCHAR* CmdLine
)

Checks if this platform file should be used even though it was not asked to be.

Public function Virtual

void

 

Tick()

Platform file can override this to get a regular tick from the engine

Classes

Name

Description

Public class

FDirectoryStatVisitor

Base class for file and directory visitors that take all the stat data.

Public class

FDirectoryVisitor

Base class for file and directory visitors that take only the name.

Public class

IFileServerMessageHandler

Helper class to send/receive data to the file server function

Typedefs

Name

Description

FDirectoryStatVisitorFunc

File and directory visitor function that takes all the stat data

FDirectoryVisitorFunc

File and directory visitor function that takes only the name

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback