Einzelnen Beitrag anzeigen

Alex_ITA01

Registriert seit: 22. Sep 2003
1.115 Beiträge
 
Delphi 12 Athens
 
#24

AW: TFileStream crasht bei Dateiname=285 Zeichen mit Unicode

  Alt 22. Sep 2022, 10:29
Hallo zusammen,
ich habe ein ähnliches Problem und die Angabe des UNC Namen hilft bei mir leider nicht.

Diese Variante geht nicht (Fehlermeldung bei TFileStream.Create(OutputFileName))
Delphi-Quellcode:
var
  InputStream, OutputStream: TFileStream;
  InputFileName, OutputFileName: String;
begin
  InputFileName := 'C:\Temp\Test.txt';
  OutputFileName := '\\x.x.x.x\l\MeinOrdner\_Transfer\H_I_E_R_L_I_E_G_T_E_I_N_O_R_D_N_E_R\J_A_H_R\M_O_N_A_T\';
  OutputFileName := OutputFileName + 'D_A_S_I_S_T_E_I_N_T_E_S_T_M_I_T_E_I_N_E_M_L_A_N_G_E_N_N_A_M_E_N\';
  OutputFileName := OutputFileName + 'D_A_S_I_S_T_E_I_N_T_E_S_T_M_I_T_E_I_N_E_M_L_A_N_G_E_N_N_A_M_E_N\';
  OutputFileName := OutputFileName + 'D_A_S_I_S_T_E_I_N_T_E_S_T_M_I_T_E_I_N_E_M_L_A_N_G_E_N_N_A_M_E_N';

  InputStream := TFileStream.Create(InputFileName, fmOpenRead);
  try
    OutputStream := TFileStream.Create(OutputFileName, fmCreate);
    try

    finally
      OutputStream.Free;
    end;
  finally
    InputStream.Free;
  end;
Diese Variante geht (KEINE Fehlermeldung)
Delphi-Quellcode:
var
  InputStream, OutputStream: TFileStream;
  InputFileName, OutputFileName: String;
begin
  InputFileName := 'C:\Temp\Test.txt';
  OutputFileName := '\\x.x.x.x\l\MeinOrdner\_Transfer\H_I_E_R_L_I_E_G_T_E_I_N_O_R_D_N_E_R\J_A_H_R\M_O_N_A_T\';
  OutputFileName := OutputFileName + 'D_A_S_I_S_T_E_I_N_T_E_S_T_M_I_T_E_I_N_E_M_L_A_N_G_E_N_N_A_M_E_N\';
  OutputFileName := OutputFileName + 'D_A_S_I_S_T_E_I_N_T_E_S_T_M_I_T_E_I_N_E_M_L_A_N_G_E_N_N_A_M_E_N\';
  OutputFileName := OutputFileName + 'D_A_S';

  InputStream := TFileStream.Create(InputFileName, fmOpenRead);
  try
    OutputStream := TFileStream.Create(OutputFileName, fmCreate);
    try

    finally
      OutputStream.Free;
    end;
  finally
    InputStream.Free;
  end;
Wie bekomme ich es hin, dass die Max_Path Angabe nicht genommen wird?
Habe Windows 10 64x
Let's fetz sprach der Frosch und sprang in den Mixer
  Mit Zitat antworten Zitat