![]() |
Dostounix
Hat jemand mal ein schöne Implementierung für DOSTOUNIX ??
UNIX2DOS habe ich schon
Delphi-Quellcode:
procedure Unix2Dos(UnixTEXTFile, DosTEXTFile : String);
Const CR : Char = #13; LF = #10; Var InFile, OutFile : File; InByte : Char; begin Assign (InFile, UnixTEXTFile); ReSet (InFile, 1); Assign (OutFile, DosTEXTFile); ReWrite (OutFile, 1); while NOT EOF (InFile) do begin BlockRead (InFile, InByte, 1); if InByte = LF then BlockWrite (OutFile, CR, 1); BlockWrite (OutFile, InByte, 1); end; Close (OutFile); Close (InFile); end; |
AW: Dostounix
Wenn es bei dem Muster bleiben soll:
Delphi-Quellcode:
Macht allerdings keinen besonders performanten Eindruck.
if InByte <> CR then
BlockWrite (OutFile, InByte, 1); |
AW: Dostounix
Zitat:
|
AW: Dostounix
Vor allem macht das Sinn, wenn man eine Textdatei mit einem Multibyte-Encoding verarbeiten will ;)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:29 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz