[fpc-pascal] EFCreateError' Unable to create file

Bart bartjunk64 at gmail.com
Sun Jan 25 12:36:56 CET 2009

>  >            Try
>  >            Memo1.Lines.SaveToFile(ExecuteName);
>  >            Except ShowMessage('Shoots, couldnt SaveToFile!');
>  >            end;
>  >
>  > [Project raised exception class 'EFCreateError' with message:
>  > Unable to create file
>  > ""C:lazarusfpc2.2.2bini386-win32Del2PasDel2PasDel2Pas.bat""]

You cannot create filenames that have double quotes (") in them on
Windows (your ExecuteName has double quotes in it as you stated
yourself), so the EFCreateError is correct.

See for yourself:

    On E: Exception do
      ShowMessage('Exception occurred of '+E.ClassName+LineEnding+
        'Attempted to save to:'+LineEnding+>'+ExecuteName+'<');

And you will see:

Exception occurred of EFCreateError
Attempted to save to:

And you will see the double quotes in the filename...

I tested your code in Lazarus and in Delphi and both raise the error
with the filename you supplied to SaveTofile (that is with all
backslashes intact), so I cannot reproduce the second part of your


More information about the fpc-pascal mailing list