Ja genau... muss ich mal testen.
Delphi-Quellcode:
ProgPath:=ExtractFilePath(ParamStr(0));
function KannIchSchreiben(const FileName: String): Boolean;
var
fileHandle: Integer;
begin
fileHandle := FileOpen(FileName, fmOpenWrite);
result := (fileHandle >= 0);
if result then begin
FileClose(fileHandle);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if KannIchSchreiben(ProgPath + '\' + 'test.txt') then showmessage('ja') else showmessage('nein');
end;