Du kannst nicht ins Programmverzeichnis und auch nicht ins Systemverzeichnis schreibend zugreifen. Du kannst folgende Procedure benutzen:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| function IsDirWritable(Dir: string): boolean; var stream: TFileStream; begin try stream := TFileStream.Create(Dir+'\dummy.dat',fmCreate); result := true; FreeAndNil(stream); DeleteFile(Dir+'\dummy.dat'); except result := false; FreeAndNil(stream); end; end; |
_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot