Autor Beitrag
opactium
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Sa 22.12.07 19:19 
hallo zusammen

also ich fuehre mit meinem delphi prorgamm ein externes program aus, das eine textdatei auf C:\ anlegt. jetzt moechte ich diese gerne wieder einlesen. nur wenn das externe programm noch nicht fertig ist, gibt einen I/O error 32, da die datei ja immer noch gebraucht wird.

wie kriege ich das nun hin, dass ich zuerst cheken kann, ob die datei auch wirklich nicht mehr verwendet wird? es muss so sein, denn ich will die datei ja erst einlesen, wenn sie komplett fertig ist, und das ist sie, wenn sie niemand anders mehr bracuht.

ThX
LorenzS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

MS-DOS, WIN 7, WIN 10
BP7.0, D3, D5
BeitragVerfasst: Sa 22.12.07 19:29 
Lösung {$I-},{$I+} und IOResult
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
 AssignFile(F, 'c:\Spy.txt');
 {$I-}
  Reset(F);
 {$I+}
 if IOResult <> 0 then
  MessageDlg('Fehler beim Zugriff auf die Datei', mtWarning, [mbOk], 0)
 else
 begin
  //öffnen ok
  ....
  //weiter verarbeitung der datei
 end;
opactium Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Sa 22.12.07 19:52 
thx funkt super..