static bool GetFiles(string pattern, inout array<ref CF_File> files, FindFileFlags flags = 2)
pattern
The search pattern
files
[inout] An array where the list of files will be written to
flags
If it should be looked in directories or .pak files, or both
If any files were found that matched the pattern
array<ref CF_File> files();
CF_Directory.GetFiles("$profile:script*", files);
foreach (auto file : files)
{
Print(file.GetDebugName());
}
Creates all directories and subdirectories in the specified path unless they already exist.
static bool CreateDirectory(string directory)
directory
The directory to create.
If the directories could be created
Returns the directory information for the specified path.
static string GetDirectoryName(CF_String path)
path
The path of a file or directory.
Directory information for path. Returns an empty string if path does not contain directory information.
Returns the file name and extension of the specified path string.
static string GetFileName(string path)
path
The path string from which to obtain the file name and extension.
The characters after the last directory separator character in path. If the last character of path is a directory or volume separator character, this method returns an empty string.
Returns the file name and extension of the specified path string.
static string GetFileNameEx(string path, string folder)
path
The path string from which to obtain the file name and extension.
The characters after the last directory separator character in path. If the last character of path is a directory or volume separator character, this method returns an empty string.
Returns the file name of the specified path string.
static string GetFileNameWithoutExtension(string path)
path
The path string from which to obtain the file name.
The characters after the last directory separator character in path. If the last character of path is a directory or volume separator character, this method returns an empty string.
Returns the file name of the specified path string.
static string GetFileNameWithoutExtensionEx(string path, string folder)
path
The path string from which to obtain the file name.
The characters after the last directory separator character in path. If the last character of path is a directory or volume separator character, this method returns an empty string.
Returns the extension (including the period ".") of the specified path string.
static string GetExtension(CF_String path)
path
The path string from which to get the extension.
The path string from which to get the extension. If path does not have extension information, this method returns an empty string.
Returns the path, including file name and extension if they exist
string GetFullPath()
Returns the path, including file name and extension if they exist
Returns the file name and extension
string GetFileName()
Returns the file name and extension
Returns the file name without the extension
string GetFileNameWithoutExtension()
Returns the file name without the extension
Returns the extension (including the period ".")
string GetExtension()
Returns the extension (including the period ".")
Returns the full path of the parent folder
string GetDirectory()
Returns the full path of the parent folder
Creates and opens a new instance of a FileStream for the current file
CF_Stream CreateStream(FileMode mode)
mode
Sets the file mode the stream will be opened in
new instance of CF_FileStream
Deletes the current file
bool Delete()
true if the operation was successful
Renames the current file (copy to new name, then delete original)
bool Rename(string name)
name
The new name of the file
true if the operation was successful
Moves the file to the new path (copy to folder, then delete original)
bool Move(string name)
path
The new path
true if the operation was successful
Copies the file to the new path
bool Copy(string name)
path
The new path
true if the operation was successful
Copies the file to the new path, returning the instance of the file
bool Copy(string path, out CF_File newFile)
path
The new path
newFile
[out] Outputs the new instance of the file
true if the operation was successful