Skip to main content

Class FilesystemUtil

Helper functions for filesystem operations.

Assembly: Dalamud.dll
View Source
Declaration
public static class FilesystemUtil

Methods

WriteAllTextSafe(string, string)

Overwrite text in a file by first writing it to a temporary file, and then moving that file to the path specified.

View Source
Declaration
public static void WriteAllTextSafe(string path, string text)
Parameters
TypeNameDescription
System.StringpathThe path of the file to write to.
System.StringtextThe text to write.

WriteAllTextSafe(string, string, Encoding)

Overwrite text in a file by first writing it to a temporary file, and then moving that file to the path specified.

View Source
Declaration
public static void WriteAllTextSafe(string path, string text, Encoding encoding)
Parameters
TypeNameDescription
System.StringpathThe path of the file to write to.
System.StringtextThe text to write.
System.Text.EncodingencodingEncoding to use.

WriteAllBytesSafe(string, byte[])

Overwrite data in a file by first writing it to a temporary file, and then moving that file to the path specified.

View Source
Declaration
public static void WriteAllBytesSafe(string path, byte[] bytes)
Parameters
TypeNameDescription
System.StringpathThe path of the file to write to.
System.Byte[]bytesThe data to write.