Autor Beitrag
Saarpoint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 199

Win XP Home, Vista Home Premium
D5 Std, D7 pers., D2005 Pro. SP3, TurboDelphi
BeitragVerfasst: Mi 08.02.06 21:08 
Hallo!

Ich möchte in einem Verzeichnis alle Dateien einlesen, bei denen es sich um reine Textdateien handelt, also *.TXT, *.INI, *.LOG, etc.

Gibt es eine Möglichkeit, bereits vorm Öffnen der Datei festzustellen,
ob die Datei reinen Text enthält, oder nur binär ausgelesen kann?

Gruß, Andreas

PS: Beim Delphi-Treff 2006 in Frankfurt dabei! :D
Bin froh, dass es diesmal nur 170km sind.
Nach Kassel musste ich über 400km fahren und übernachten...

_________________
Standart := false; Standard := true;
afk
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

Win 2K, Win XP
Delphi 2006 Arch., Delphi 6 Ent., MS-SQL 2005 & 2000
BeitragVerfasst: Mi 08.02.06 23:54 
Entweder Du kannst Dich auf die Endung verlassen, oder Du mußt Deinem Programm das Hellsehen beibringen ... :wink:

Gruß Axel

_________________
Man muß sparn wo mn knn !
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 09.02.06 15:56 
Dateien werden immer binär gelesen ...

Ansonsten: Datei in nem Stream öffnen und Zeichenweise auf C in [#10,#13,#26,#32..#255] prüfen... Wenn das für jedes Zeichen erfüllt ist, hast Du eine Textdatei.

P.S.: #26 ist EOF

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.