Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-01

TStringList.SaveToFile loses path deliminators - possible bug?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dave Coventry

Hi.

v0.9.27 r15984:15992M i386-win32-win32/win64

ConfigFile := GetAppConfigFile(false);
Configs.SaveToFile(ConfigFile);

Gives the error:

Unable to create the file "C:Documents and SettingsdaveLocal SettingsApplication Databarbillbarbill.cfg"

ConfigFile Variable contains "C:\Documents and Settings\dave\Local Settings\Application Data\barbill\barbill.cfg" as expected.

Reply by email

Bart
to Dave Coventry

As I understood form another thread: the error is correct, but the message is handled wrong (backspaces are removed). So it did actually try to create
C:\Documents and Settings\dave\Local Settings\Application Data\barbill\barbill.cfg
(I suppose you did not insert double quotes (") around the filename (I mean ConfiFile = 'bla' and not ConfigFile = '"bla"').

Bart

Reply by email

Dave Coventry
to Bart

Bart,

No Bug.

I had simply failed to create the Directory that the Config file is written to.

What threw me was the error message which had all the backslashes stripped out of the path string.

Sorry to have brought this up.

Reply by email