Autor Beitrag
Unknown
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Mo 03.03.08 16:09 
Hallo Team,

wie kann ich testen, ob die gegebene Datei existiert ?
zB habe ich vollgenden Quellcode
ausblenden Delphi-Quelltext
1:
Memo1.lines.savetofile(Extractfilepath(paramstr(0))+'unknown.txt');					


So, und nun will ich testen ob diese Datei existiert.
Also ungefähr so
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if existFile(Extractfilepath(paramstr(0))+'unknown.txt') = 1
 then 
  begin
  end;


Wie ist dies möglich ?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 03.03.08 16:15 
FileExists()

_________________
Markus Kinzler.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mo 03.03.08 16:15 
FileExists() heißt der Befehl.
ODER if FileAge('dateiname') <> -1 then...

Grüße,
Marc.
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Mo 03.03.08 16:18 
ich hatts fast. ^^

dankeschön