unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl;
type
TForm1 =
class(TForm)
btnQuit: TButton;
btnUnix2Win: TButton;
FileList: TFileListBox;
DirList: TDirectoryListBox;
cbx: TDriveComboBox;
Label1: TLabel;
Edit1: TEdit;
procedure btnUnix2WinClick(Sender: TObject);
procedure btnQuitClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure Unix2Win(
const AFileName:
String);
var
fFile: TStrings;
i: Integer;
begin
fFile := TStringList.Create;
try
fFile.LoadFromFile(AFileName);
for i := 0
to fFile.Count - 1
do
fFile[i] := StringReplace(fFile[i], #13, #10+#13, [rfReplaceAll]);
fFile.SaveToFile(AFileName);
finally
fFile.Free;
end;
end;
procedure TForm1.btnUnix2WinClick(Sender: TObject);
var Index: Integer; Path,Current:
String;
begin
for Index := 0
to FileList.Items.Count-1
do
begin
Path := Label1.Caption;
if Path[Length(Path)]<>'
\'
then Path := Path + '
\';
if FileList.Selected[
Index]
then
Current := FileList.Items[
Index];
// ExtractFilePath(Current);
// Unix2Win(Path+Current); //führt leider nicht zum Ziel. Warum?
Unix2Win(ExtractFilePath(Current));
end;
end;
procedure TForm1.btnQuitClick(Sender: TObject);
begin
Application.Terminate;
end;
end.