fileutil/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: fileutil/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | L'unité Lazarus **fileutil** contient des fonctions et des procédures pour maintenir la compatibilité avec l'unité FileUtil de Delphi. Les routines de fichier qui traitent spécialement les noms de fichiers UTF8 sont dans l'unité [[LazFileUtils/fr|LazFileUtils]]. | |
| 2 | + | ||
| 3 | + | **Attention** : de nombreuses fonctions de cette unité sont marquées comme **deprecated**. Avec la version 1.8 de Lazarus, elles sont même inaccessibles par défaut. Il est par conséquent nécessaire d'utiliser soit l'unité **UTF8** soit l'unité **LazFileUtils** pour la plupart de ces fonctions. | |
| 4 | + | ||
| 5 | + | Les seuls constantes, types, classes et routines encore utilisables sont : | |
| 6 | + | ||
| 7 | + | ` // constantes`\ | |
| 8 | + | `const`\ | |
| 9 | + | ` UTF8FileHeader = #$ef#$bb#$bf;`\ | |
| 10 | + | ` FilenamesCaseSensitive = {$IFDEF CaseInsensitiveFilenames}false{$ELSE}true{$ENDIF};`\ | |
| 11 | + | ` FilenamesLiteral = {$IFDEF NotLiteralFilenames}false{$ELSE}true{$ENDIF};` | |
| 12 | + | ||
| 13 | + | ` // opérations sur les répertoires et les fichiers`\ | |
| 14 | + | ` function ComparePhysicalFilenames(const Filename1, Filename2: string): integer;`\ | |
| 15 | + | ` function CompareFilenames(Filename1: PChar; Len1: integer; Filename2: PChar; Len2: integer; ResolveLinks: boolean): integer; overload;`\ | |
| 16 | + | ` function ExtractShortPathNameUTF8(Const FileName : String) : String;`\ | |
| 17 | + | ` function DeleteDirectory(const DirectoryName: string; OnlyChildren: boolean): boolean;`\ | |
| 18 | + | ` function ProgramDirectory: string;`\ | |
| 19 | + | ` function ExpandUNCFileNameUTF8(const FileName: string): string;`\ | |
| 20 | + | ` function FileSize(const Filename: string): int64; overload; inline;`\ | |
| 21 | + | ` function ExtractFileNameWithoutExt(const AFilename: string): string;`\ | |
| 22 | + | ` function FilenameIsPascalUnit(const Filename: string): boolean;`\ | |
| 23 | + | ` function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string;`\ | |
| 24 | + | ` function CreateAbsolutePath(const Filename, BaseDirectory: string): string;`\ | |
| 25 | + | ` function FileIsInPath(const Filename, Path: string): boolean;`\ | |
| 26 | + | ` function FileIsInDirectory(const Filename, Directory: string): boolean;`\ | |
| 27 | + | ` function GetAllFilesMask: string; inline;`\ | |
| 28 | + | ` function GetExeExt: string; inline;`\ | |
| 29 | + | ` function ReadFileToString(const Filename: string): string;` | |
| 30 | + | ||
| 31 | + | ` // recherche de fichiers`\ | |
| 32 | + | ` type`\ | |
| 33 | + | ` TSearchFileInPathFlag = (`\ | |
| 34 | + | ` sffDontSearchInBasePath, // do not search in BasePath, search only in SearchPath.`\ | |
| 35 | + | ` sffSearchLoUpCase`\ | |
| 36 | + | ` );`\ | |
| 37 | + | ` TSearchFileInPathFlags = set of TSearchFileInPathFlag;`\ | |
| 38 | + | ` function SearchFileInPath(const Filename, BasePath, SearchPath, Delimiter: string; Flags: TSearchFileInPathFlags): string; overload;`\ | |
| 39 | + | ` function SearchAllFilesInPath(const Filename, BasePath, SearchPath,Delimiter: string; Flags: TSearchFileInPathFlags): TStrings;`\ | |
| 40 | + | ` function FindDiskFilename(const Filename: string): string;`\ | |
| 41 | + | ` function FindDiskFileCaseInsensitive(const Filename: string): string;`\ | |
| 42 | + | ` function FindDefaultExecutablePath(const Executable: string; const BaseDir: string = ''): string;` | |
| 43 | + | ||
| 44 | + | ` type`\ | |
| 45 | + | ` { TFileIterator }`\ | |
| 46 | + | ` TFileIterator = class`\ | |
| 47 | + | ` private`\ | |
| 48 | + | ` FPath: String;`\ | |
| 49 | + | ` FLevel: Integer;`\ | |
| 50 | + | ` FFileInfo: TSearchRec;`\ | |
| 51 | + | ` FSearching: Boolean;`\ | |
| 52 | + | ` function GetFileName: String;`\ | |
| 53 | + | ` public`\ | |
| 54 | + | ` procedure Stop;`\ | |
| 55 | + | ` function IsDirectory: Boolean;`\ | |
| 56 | + | ` public`\ | |
| 57 | + | ` property FileName: String read GetFileName;`\ | |
| 58 | + | ` property FileInfo: TSearchRec read FFileInfo;`\ | |
| 59 | + | ` property Level: Integer read FLevel;`\ | |
| 60 | + | ` property Path: String read FPath;`\ | |
| 61 | + | ` property Searching: Boolean read FSearching;`\ | |
| 62 | + | ` end;` | |
| 63 | + | ||
| 64 | + | ` TFileFoundEvent = procedure (FileIterator: TFileIterator) of object;`\ | |
| 65 | + | ` TDirectoryFoundEvent = procedure (FileIterator: TFileIterator) of object;`\ | |
| 66 | + | ` TDirectoryEnterEvent = procedure (FileIterator: TFileIterator) of object;` | |
| 67 | + | ||
| 68 | + | ` { TFileSearcher }`\ | |
| 69 | + | ` TFileSearcher = class(TFileIterator)`\ | |
| 70 | + | ` private`\ | |
| 71 | + | ` FMaskSeparator: char;`\ | |
| 72 | + | ` FFollowSymLink: Boolean;`\ | |
| 73 | + | ` FOnFileFound: TFileFoundEvent;`\ | |
| 74 | + | ` FOnDirectoryFound: TDirectoryFoundEvent;`\ | |
| 75 | + | ` FOnDirectoryEnter: TDirectoryEnterEvent;`\ | |
| 76 | + | ` FFileAttribute: Word;`\ | |
| 77 | + | ` FDirectoryAttribute: Word;`\ | |
| 78 | + | ` procedure RaiseSearchingError;`\ | |
| 79 | + | ` protected`\ | |
| 80 | + | ` procedure DoDirectoryEnter; virtual;`\ | |
| 81 | + | ` procedure DoDirectoryFound; virtual;`\ | |
| 82 | + | ` procedure DoFileFound; virtual;`\ | |
| 83 | + | ` public`\ | |
| 84 | + | ` constructor Create;`\ | |
| 85 | + | ` procedure Search(ASearchPath: String; ASearchMask: String = '';`\ | |
| 86 | + | ` ASearchSubDirs: Boolean = True; CaseSensitive: Boolean = False);`\ | |
| 87 | + | ` public`\ | |
| 88 | + | ` property MaskSeparator: char read FMaskSeparator write FMaskSeparator;`\ | |
| 89 | + | ` property FollowSymLink: Boolean read FFollowSymLink write FFollowSymLink;`\ | |
| 90 | + | ` property FileAttribute: Word read FFileAttribute write FFileAttribute default faAnyfile;`\ | |
| 91 | + | ` property DirectoryAttribute: Word read FDirectoryAttribute write FDirectoryAttribute default faDirectory;`\ | |
| 92 | + | ` property OnDirectoryFound: TDirectoryFoundEvent read FOnDirectoryFound write FOnDirectoryFound;`\ | |
| 93 | + | ` property OnFileFound: TFileFoundEvent read FOnFileFound write FOnFileFound;`\ | |
| 94 | + | ` property OnDirectoryEnter: TDirectoryEnterEvent read FOnDirectoryEnter write FOnDirectoryEnter;`\ | |
| 95 | + | ` end;` | |
| 96 | + | ||
| 97 | + | ` { TListFileSearcher }`\ | |
| 98 | + | ` TListFileSearcher = class(TFileSearcher)`\ | |
| 99 | + | ` private`\ | |
| 100 | + | ` FList: TStrings;`\ | |
| 101 | + | ` protected`\ | |
| 102 | + | ` procedure DoFileFound; override;`\ | |
| 103 | + | ` public`\ | |
| 104 | + | ` constructor Create(AList: TStrings);`\ | |
| 105 | + | ` end;` | |
| 106 | + | ||
| 107 | + | ` { TListDirectoriesSearcher }`\ | |
| 108 | + | ` TListDirectoriesSearcher = class(TFileSearcher)`\ | |
| 109 | + | ` private`\ | |
| 110 | + | ` FDirectoriesList :TStrings;`\ | |
| 111 | + | ` protected`\ | |
| 112 | + | ` procedure DoDirectoryFound; override;`\ | |
| 113 | + | ` public`\ | |
| 114 | + | ` constructor Create(AList: TStrings);`\ | |
| 115 | + | ` end;` | |
| 116 | + | ||
| 117 | + | ` function FindAllFiles(const SearchPath: String; SearchMask: String = ''; SearchSubDirs: Boolean = True; DirAttr: Word = faDirectory): TStringList; overload;`\ | |
| 118 | + | ` procedure FindAllFiles(AList: TStrings; const SearchPath: String; SearchMask: String = ''; SearchSubDirs: Boolean = True; DirAttr: Word = faDirectory); overload;`\ | |
| 119 | + | ` function FindAllDirectories(const SearchPath: string; SearchSubDirs: Boolean = True): TStringList; overload;`\ | |
| 120 | + | ` procedure FindAllDirectories(AList: TStrings; const SearchPath: String; SearchSubDirs: Boolean = true); overload;` | |
| 121 | + | ||
| 122 | + | ` // drapeaux pour les copies`\ | |
| 123 | + | `type`\ | |
| 124 | + | ` TCopyFileFlag = (`\ | |
| 125 | + | ` cffOverwriteFile,`\ | |
| 126 | + | ` cffCreateDestDirectory,`\ | |
| 127 | + | ` cffPreserveTime`\ | |
| 128 | + | ` );`\ | |
| 129 | + | ` TCopyFileFlags = set of TCopyFileFlag;` | |
| 130 | + | ||
| 131 | + | ` // copies`\ | |
| 132 | + | ` function CopyFile(const SrcFilename, DestFilename: string; Flags: TCopyFileFlags=[cffOverwriteFile]; ExceptionOnError: Boolean=False): boolean;`\ | |
| 133 | + | ` function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: boolean; ExceptionOnError: Boolean=False): boolean;`\ | |
| 134 | + | ` function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean;` | |
| 135 | + | ||
| 136 | + | ` // noms de fichiers`\ | |
| 137 | + | ` const`\ | |
| 138 | + | ` PascalFileExt: array[1..3] of string = ('.pas','.pp','.p');`\ | |
| 139 | + | ` PascalSourceExt: array[1..6] of string = ('.pas','.pp','.p','.lpr','.dpr','.dpk');`\ | |
| 140 | + | ` AllDirectoryEntriesMask = '*';` | |
| 141 | + | ||
| 142 | + | Ce qui suit ne s'applique que pour les versions antérieures à la version 1.8. La version 1.6.4 mentionne déjà bon nombre de ces fonctions comme **deprecated**. | |
| 143 | + | ||
| 144 | + | ` // file attributes and states`\ | |
| 145 | + | `function CompareFilenames(const Filename1, Filename2: string): integer; inline;`\ | |
| 146 | + | `function CompareFilenamesIgnoreCase(const Filename1, Filename2: string): integer; inline;`\ | |
| 147 | + | `function CompareFilenames(const Filename1, Filename2: string; ResolveLinks: boolean): integer;`\ | |
| 148 | + | `function CompareFilenames(Filename1: PChar; Len1: integer; Filename2: PChar; Len2: integer; ResolveLinks: boolean): integer;`\ | |
| 149 | + | `function FilenameIsAbsolute(const TheFilename: string):boolean; inline;`\ | |
| 150 | + | `function FilenameIsWinAbsolute(const TheFilename: string):boolean; inline;`\ | |
| 151 | + | `function FilenameIsUnixAbsolute(const TheFilename: string):boolean; inline;`\ | |
| 152 | + | `procedure CheckIfFileIsExecutable(const AFilename: string); inline;`\ | |
| 153 | + | `procedure CheckIfFileIsSymlink(const AFilename: string); inline;`\ | |
| 154 | + | `function FileIsReadable(const AFilename: string): boolean; inline;`\ | |
| 155 | + | `function FileIsWritable(const AFilename: string): boolean; inline;`\ | |
| 156 | + | `function FileIsText(const AFilename: string): boolean; inline;`\ | |
| 157 | + | `function FileIsText(const AFilename: string; out FileReadable: boolean): boolean; inline;`\ | |
| 158 | + | `function FileIsExecutable(const AFilename: string): boolean; inline;`\ | |
| 159 | + | `function FileIsSymlink(const AFilename: string): boolean; inline;`\ | |
| 160 | + | `function FileIsHardLink(const AFilename: string): boolean; inline;`\ | |
| 161 | + | `function FileSize(const Filename: string): int64; overload; inline;`\ | |
| 162 | + | `function GetFileDescription(const AFilename: string): string; inline;`\ | |
| 163 | + | `function ReadAllLinks(const Filename: string; ExceptionOnError: boolean): string; // if a link is broken returns ''`\ | |
| 164 | + | `function TryReadAllLinks(const Filename: string): string; // if a link is broken returns Filename `\ | |
| 165 | + | ||
| 166 | + | ` // directories`\ | |
| 167 | + | `function DirPathExists(const FileName: String): Boolean; inline;`\ | |
| 168 | + | `function ForceDirectory(DirectoryName: string): boolean; inline;`\ | |
| 169 | + | `function DeleteDirectory(const DirectoryName: string; OnlyChildren: boolean): boolean;`\ | |
| 170 | + | `function ProgramDirectory: string;`\ | |
| 171 | + | `function DirectoryIsWritable(const DirectoryName: string): boolean; inline;`\ | |
| 172 | + | ||
| 173 | + | ` // filename parts`\ | |
| 174 | + | `function ExtractFileNameOnly(const AFilename: string): string; inline;`\ | |
| 175 | + | `function ExtractFileNameWithoutExt(const AFilename: string): string;`\ | |
| 176 | + | `function CompareFileExt(const Filename, Ext: string; CaseSensitive: boolean): integer; overload; inline;`\ | |
| 177 | + | `function CompareFileExt(const Filename, Ext: string): integer; overload; inline;`\ | |
| 178 | + | `function FilenameIsPascalUnit(const Filename: string): boolean;`\ | |
| 179 | + | `function AppendPathDelim(const Path: string): string; inline;`\ | |
| 180 | + | `function ChompPathDelim(const Path: string): string; inline;`\ | |
| 181 | + | `function TrimFilename(const AFilename: string): string; inline;`\ | |
| 182 | + | `function CleanAndExpandFilename(const Filename: string): string; inline;`\ | |
| 183 | + | `function CleanAndExpandDirectory(const Filename: string): string; inline;`\ | |
| 184 | + | `function CreateAbsoluteSearchPath(const SearchPath, BaseDirectory: string): string;`\ | |
| 185 | + | `function CreateRelativePath(const Filename, BaseDirectory: string; UsePointDirectory: boolean = false; AlwaysRequireSharedBaseFolder: Boolean = True): string; inline;`\ | |
| 186 | + | `function CreateAbsolutePath(const Filename, BaseDirectory: string): string;`\ | |
| 187 | + | `function FileIsInPath(const Filename, Path: string): boolean;`\ | |
| 188 | + | `function FileIsInDirectory(const Filename, Directory: string): boolean; `\ | |
| 189 | + | ||
| 190 | + | `// file search`\ | |
| 191 | + | `type`\ | |
| 192 | + | ` TSearchFileInPathFlag = (`\ | |
| 193 | + | ` sffDontSearchInBasePath,`\ | |
| 194 | + | ` sffSearchLoUpCase`\ | |
| 195 | + | ` );`\ | |
| 196 | + | ` TSearchFileInPathFlags = set of TSearchFileInPathFlag;`\ | |
| 197 | + | `const`\ | |
| 198 | + | ` AllDirectoryEntriesMask = '*';`\ | |
| 199 | + | ` `\ | |
| 200 | + | `function GetAllFilesMask: string; inline;`\ | |
| 201 | + | `function GetExeExt: string; inline;`\ | |
| 202 | + | `function SearchFileInPath(const Filename, BasePath, SearchPath, Delimiter: string; Flags: TSearchFileInPathFlags): string;`\ | |
| 203 | + | `function SearchAllFilesInPath(const Filename, BasePath, SearchPath, Delimiter: string; Flags: TSearchFileInPathFlags): TStrings;`\ | |
| 204 | + | `function FindDiskFilename(const Filename: string): string;`\ | |
| 205 | + | `function FindDiskFileCaseInsensitive(const Filename: string): string;`\ | |
| 206 | + | `function FindDefaultExecutablePath(const Executable: string; const BaseDir: string = ''): string;`\ | |
| 207 | + | ||
| 208 | + | `type`\ | |
| 209 | + | ` TFileIterator = class`\ | |
| 210 | + | ` private`\ | |
| 211 | + | ` FPath: String;`\ | |
| 212 | + | ` FLevel: Integer;`\ | |
| 213 | + | ` FFileInfo: TSearchRec;`\ | |
| 214 | + | ` FSearching: Boolean;`\ | |
| 215 | + | ` function GetFileName: String;`\ | |
| 216 | + | ` public`\ | |
| 217 | + | ` procedure Stop;`\ | |
| 218 | + | ` function IsDirectory: Boolean;`\ | |
| 219 | + | ` public`\ | |
| 220 | + | ` property FileName: String read GetFileName;`\ | |
| 221 | + | ` property FileInfo: TSearchRec read FFileInfo;`\ | |
| 222 | + | ` property Level: Integer read FLevel;`\ | |
| 223 | + | ` property Path: String read FPath;`\ | |
| 224 | + | ` property Searching: Boolean read FSearching;`\ | |
| 225 | + | ` end;`\ | |
| 226 | + | ||
| 227 | + | ` TFileFoundEvent = procedure (FileIterator: TFileIterator) of object;`\ | |
| 228 | + | ` TDirectoryFoundEvent = procedure (FileIterator: TFileIterator) of object;`\ | |
| 229 | + | ` TDirectoryEnterEvent = procedure (FileIterator: TFileIterator) of object;`\ | |
| 230 | + | ||
| 231 | + | ` TFileSearcher = class(TFileIterator)`\ | |
| 232 | + | ` private`\ | |
| 233 | + | ` FMaskSeparator: char;`\ | |
| 234 | + | ` FFollowSymLink: Boolean;`\ | |
| 235 | + | ` FOnFileFound: TFileFoundEvent;`\ | |
| 236 | + | ` FOnDirectoryFound: TDirectoryFoundEvent;`\ | |
| 237 | + | ` FOnDirectoryEnter: TDirectoryEnterEvent;`\ | |
| 238 | + | ` FFileAttribute: Word;`\ | |
| 239 | + | ` FDirectoryAttribute: Word;`\ | |
| 240 | + | ` procedure RaiseSearchingError;`\ | |
| 241 | + | ` protected`\ | |
| 242 | + | ` procedure DoDirectoryEnter; virtual;`\ | |
| 243 | + | ` procedure DoDirectoryFound; virtual;`\ | |
| 244 | + | ` procedure DoFileFound; virtual;`\ | |
| 245 | + | ` public`\ | |
| 246 | + | ` constructor Create;`\ | |
| 247 | + | ` procedure Search(const ASearchPath: String; ASearchMask: String = '';`\ | |
| 248 | + | ` ASearchSubDirs: Boolean = True; CaseSensitive: Boolean = False);`\ | |
| 249 | + | ` public`\ | |
| 250 | + | ` property MaskSeparator: char read FMaskSeparator write FMaskSeparator;`\ | |
| 251 | + | ` property FollowSymLink: Boolean read FFollowSymLink write FFollowSymLink;`\ | |
| 252 | + | ` property FileAttribute: Word read FFileAttribute write FFileAttribute default faAnyfile;`\ | |
| 253 | + | ` property DirectoryAttribute: Word read FDirectoryAttribute write FDirectoryAttribute default faDirectory;`\ | |
| 254 | + | ` property OnDirectoryFound: TDirectoryFoundEvent read FOnDirectoryFound write FOnDirectoryFound;`\ | |
| 255 | + | ` property OnFileFound: TFileFoundEvent read FOnFileFound write FOnFileFound;`\ | |
| 256 | + | ` property OnDirectoryEnter: TDirectoryEnterEvent read FOnDirectoryEnter write FOnDirectoryEnter;`\ | |
| 257 | + | ` end;`\ | |
| 258 | + | ||
| 259 | + | `function `[[FindAllFiles/fr|FindAllFiles]]`( const SearchPath: String; SearchMask: String = ''; SearchSubDirs: Boolean = True): TStringList;`\ | |
| 260 | + | `function FindAllDirectories(const SearchPath: string; SearchSubDirs: Boolean = True): TStringList;`\ | |
| 261 | + | ||
| 262 | + | ` // Copy a file or a whole directory tree`\ | |
| 263 | + | `function `[[CopyFile/fr|CopyFile]]`(const SrcFilename, DestFilename: string; Flags: TCopyFileFlags=[cffOverwriteFile]): boolean;`\ | |
| 264 | + | `function `[[CopyFile/fr|CopyFile]]`(const SrcFilename, DestFilename: string; PreserveTime: boolean): boolean;`\ | |
| 265 | + | `function CopyDirTree(const SourceDir, TargetDir: string; Flags: TCopyFileFlags=[]): Boolean; `\ | |
| 266 | + | ||
| 267 | + | ` // file actions`\ | |
| 268 | + | `function ReadFileToString(const Filename: string): string;`\ | |
| 269 | + | `function GetTempFilename(const Directory, Prefix: string): string; inline; `\ | |
| 270 | + | ||
| 271 | + | ` // basic functions similar to the RTL but working with UTF-8 instead of the system encoding`\ | |
| 272 | + | ` // AnsiToUTF8 and UTF8ToAnsi need a widestring manager under Linux, BSD, MacOSX `\ | |
| 273 | + | ` // but normally these OS use UTF-8 as system encoding so the widestringmanager is not needed.`\ | |
| 274 | + | `function NeedRTLAnsi: boolean; inline;// true if system encoding is not UTF-8`\ | |
| 275 | + | `procedure SetNeedRTLAnsi(NewValue: boolean); inline;`\ | |
| 276 | + | `function UTF8ToSys(const s: string): string; inline;// as UTF8ToAnsi but more independent of widestringmanager`\ | |
| 277 | + | `function SysToUTF8(const s: string): string; inline;// as AnsiToUTF8 but more independent of widestringmanager`\ | |
| 278 | + | `function ConsoleToUTF8(const s: string): string; inline;// converts OEM encoded string to UTF8 (used with some Windows specific functions )`\ | |
| 279 | + | `function UTF8ToConsole(const s: string): string; inline;// converts UTF8 string to console encoding (used by Write, WriteLn)`\ | |
| 280 | + | ||
| 281 | + | ` // file operations`\ | |
| 282 | + | `function FileExistsUTF8(const Filename: string): boolean; inline;`\ | |
| 283 | + | `function FileAgeUTF8(const FileName: string): Longint; inline;`\ | |
| 284 | + | `function DirectoryExistsUTF8(const Directory: string): Boolean; inline;`\ | |
| 285 | + | `function ExpandFileNameUTF8(const FileName: string): string; inline;`\ | |
| 286 | + | `function ExpandUNCFileNameUTF8(const FileName: string): string;`\ | |
| 287 | + | `function ExtractShortPathNameUTF8(Const FileName : String) : String;`\ | |
| 288 | + | `function FindFirstUTF8(const Path: string; Attr: Longint; out Rslt: TSearchRec): Longint; inline;`\ | |
| 289 | + | `function FindNextUTF8(var Rslt: TSearchRec): Longint; inline;`\ | |
| 290 | + | `procedure FindCloseUTF8(var F: TSearchrec); inline;`\ | |
| 291 | + | `function FileSetDateUTF8(const FileName: String; Age: Longint): Longint; inline;`\ | |
| 292 | + | `function FileGetAttrUTF8(const FileName: String): Longint; inline;`\ | |
| 293 | + | `function FileSetAttrUTF8(const Filename: String; Attr: longint): Longint; inline;`\ | |
| 294 | + | `function DeleteFileUTF8(const FileName: String): Boolean; inline;`\ | |
| 295 | + | `function RenameFileUTF8(const OldName, NewName: String): Boolean; inline;`\ | |
| 296 | + | `function FileSearchUTF8(const Name, DirList : String; ImplicitCurrentDir : Boolean = True): String; inline;`\ | |
| 297 | + | `function FileIsReadOnlyUTF8(const FileName: String): Boolean; inline;`\ | |
| 298 | + | `function GetCurrentDirUTF8: String; inline;`\ | |
| 299 | + | `function SetCurrentDirUTF8(const NewDir: String): Boolean; inline;`\ | |
| 300 | + | `function CreateDirUTF8(const NewDir: String): Boolean; inline;`\ | |
| 301 | + | `function RemoveDirUTF8(const Dir: String): Boolean; inline;`\ | |
| 302 | + | `function ForceDirectoriesUTF8(const Dir: string): Boolean; inline;`\ | |
| 303 | + | `function FileOpenUTF8(Const FileName : string; Mode : Integer) : THandle; inline;`\ | |
| 304 | + | `function FileCreateUTF8(Const FileName : string) : THandle; overload; inline;`\ | |
| 305 | + | `function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle; overload; inline; `\ | |
| 306 | + | ||
| 307 | + | ` // environment`\ | |
| 308 | + | `function ParamStrUTF8(Param: Integer): string; inline;`\ | |
| 309 | + | `function GetEnvironmentStringUTF8(Index: Integer): string; inline;`\ | |
| 310 | + | `function GetEnvironmentVariableUTF8(const EnvVar: string): String; inline;`\ | |
| 311 | + | `function GetAppConfigDirUTF8(Global: Boolean; Create: boolean = false): string; inline;`\ | |
| 312 | + | `function GetAppConfigFileUTF8(Global: Boolean; SubDir: boolean = false; CreateDir: boolean = false): string; inline; `\ | |
| 313 | + | ||
| 314 | + | ` // other`\ | |
| 315 | + | `function SysErrorMessageUTF8(ErrorCode: Integer): String; inline;` | |
| 316 | + | ||
| 317 | + | --- | |
| 318 | + | *From the Free Pascal wiki, page "fileutil/fr", as it stood on 2017-12-07 after a change by Gillou58, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
