Menu

FOPS

Benedict Jäggi

Back to [APK_DOTNET_MAUI]

Libraries/FOPS.cs - File OPerationS

Functions for file operations.

class FOPS

This class holds (static) functions to use with paths/directories and files.
Everything here is static so it will NOT be referenced here all the time.

string GeneralApplicationPath

The directory in the local app data directory for the whole of this application. This is the root directory which you should use for everything. Get it along with the local app data path with getApplicationPath().

string getApplicationPath()

Returns the local application data path combined with the GeneralApplicationPath above, if it exists or can be created.
If the path does not exist, it will try to create it.
Returns null if failed to find or create the full path including GeneralApplicationPath.

e.g. on Windows it's C:\Users\{MyUserName}\AppData\Local\{GeneralApplicationPath}

bool CreateDirectory(string path)

Creates the (last) directory given in path.
Returns true if the path exists afterwards, false if not.

bool PathExists(string path)

Returns true if the given path exists, false if not.

string Combine(string path1, string path2)

Combines the given path1 and path2 (which also could be a filename) in the correct directory combining way and returns it.


Related

Wiki: APK_DOTNET_MAUI