Subversion Repositories autosfx

Rev

Rev 3 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 5
Line 17... Line 17...
17
function NormalizeLineBreaks(s: string; mode: TLineBreak): string;
17
function NormalizeLineBreaks(s: string; mode: TLineBreak): string;
18
function ExtractFileNameWithoutExt(const fil: string): string;
18
function ExtractFileNameWithoutExt(const fil: string): string;
19
function SearchNextFreeName(s: string; wantDir: boolean): string;
19
function SearchNextFreeName(s: string; wantDir: boolean): string;
20
function GetSpecialFolderPath(const Folder: integer): string;
20
function GetSpecialFolderPath(const Folder: integer): string;
21
function IsExtractable(AFilename: string): boolean;
21
function IsExtractable(AFilename: string): boolean;
-
 
22
function IsDirectoryWritable(const Dir: String): Boolean;
-
 
23
function IsAtFlobbyDisk(AFileOrDir: string): boolean;
22
 
24
 
23
implementation
25
implementation
24
 
26
 
25
{$IFNDEF UNICODE}
27
{$IFNDEF UNICODE}
26
type
28
type
Line 220... Line 222...
220
  finally
222
  finally
221
    uz.Free;
223
    uz.Free;
222
  end;
224
  end;
223
end;
225
end;
224
 
226
 
-
 
227
// Ref: http://www.delphiarea.com/articles/how-to-find-if-a-directory-is-writable/
-
 
228
function IsDirectoryWritable(const Dir: String): Boolean;
-
 
229
var
-
 
230
  TempFile: array[0..MAX_PATH] of Char;
-
 
231
begin
-
 
232
  if GetTempFileName(PChar(Dir), 'DA', 0, TempFile) <> 0 then
-
 
233
    Result := Windows.DeleteFile(TempFile)
-
 
234
  else
-
 
235
    Result := False;
-
 
236
end;
-
 
237
 
-
 
238
function IsAtFlobbyDisk(AFileOrDir: string): boolean;
-
 
239
var
-
 
240
  s: string;
-
 
241
begin
-
 
242
  s := ExtractFileDrive(AFileOrDir);
-
 
243
  s := UpperCase(s);
-
 
244
 
-
 
245
  result := (s = 'A:') or (s = 'B:');
-
 
246
end;
-
 
247
 
225
end.
248
end.