delphi xe10 file directory / path operations (Andorid, ios)

Obtain a temporary file path (Andrews support, the IOS)
function GeFileName (const aFileName: String): String;
the begin
{$} for ANDROID IFDEF
the Result: = TPath.GetTempPath + '/' + aFileName;
{$ the ELSE}
{} $ IFDEF the IOS
the Result : TPath.GetHomePath + = '/ Documents /' + aFileName;
{} $ the ELSE
the Result: = aFileName;
{$ ENDIF}
{$ ENDIF}
End;

IOUtils.pas description file
path type
TPath.GetTempPath; {get a temporary folder path}
TPath.GetTempFileName; {get a temporary file name}
TPath.GetPathRoot (); {extracting letter, such as: C: \}
TPath.GetDirectoryName ( ); extraction path {}
TPath.GetFileName (); {extract filename}
TPath.GetExtension (); {extracted extension}
TPath.GetFileNameWithoutExtension (); {no extraction file name extension}
TPath.ChangeExtension (); { replace extension}
TPath.DriveExists (); {inspection path drive exists}
TPath.GetFullPath ();} {gives the full path to the relative path
TPath.HasExtension (); {determines whether extension}
TPath.IsPathRooted (); determines whether the absolute path {}
TPath.Combine (); binding path {}
TPath.GetRandomFileName; {generates a random file name}
TPath.GetGUIDFileName (); {for generating a unique file name, Boolean parameter determination contain the name -}
TPath.IsValidPathChar (); {judgment whether the character can be given a path name}
TPath.IsValidFileNameChar (); {determining whether a given character can be used in file names}
TPath.AltDirectorySeparatorChar; {is the Windows "\"}
TPath.AltDirectorySeparatorChar; {is the Windows "/"}
TPath.ExtensionSeparatorChar; {Under Windows It is}. ""
TPath.PathSeparator; {is the Windows ";"}
TPath.VolumeSeparatorChar; {is the Windows ":"}

// Catalog Class
TDirectory.CreateDirectory (); {Create a new directory}
TDirectory.Exists (); {determines whether there is a folder}
TDirectory.IsEmpty (); determining whether the folder is {empty}
TDirectory.Copy (); {Copy folder}
TDirectory.Move (); move folder {}
TDirectory.Delete (); {delete folders, the second parameter is True to remove non-empty folder}
TDirectory.GetDirectoryRoot (); {get the root directory of the disc character, such as: C: \}
TDirectory.GetCurrentDirectory; {get the current directory}
TDirectory.SetCurrentDirectory (); setting the current directory {}
TDirectory.GetLogicalDrives; {get the drive list;} By way of example there
TDirectory.GetAttributes (); {Get file folder attribute, such as read-only, archive, and the like; for example have a lower}
TDirectory.SetAttributes (); {set folder attributes; the example has}

// File Class
TFile.Exists (); // whether the specified file exists
TFile.Copy (); // copy the file
TFile.Move (); // move the file
TFile.Delete (); // delete files
TFile. replace (); // replace the file

 

Last Updated: 2019.07.05

Guess you like

Origin www.cnblogs.com/guorongtao/p/11137192.html