<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi Sven,<br><br>> Date: Tue, 15 Mar 2011 16:02:55 +0100<br>> From: pascaldragon@googlemail.com<br>> To: lazarus@lists.lazarus.freepascal.org<br>> Subject: Re: [Lazarus] Unable to rewrite .ini file which exists... error unable to create .ini file. (need to rewrite it).<br>> <br>> Am 15.03.2011 15:51, schrieb Peter Williams:<br>> > I just tried calling Str1 := GetAppConfigDir(true); ShowMessage(Str1);<br>> ><br>> > and my app is called Color_Life.exe and it returns<br>> > "C:\ProgramData\Color_Life\". Since the folder "C:\ProgramData\" exists<br>> > and it's subfolder "\Color_Life\" does NOT exist, then does this mean<br>> > that I need to create it myself, or will my call to one of the<br>> > "MemIniFiles" procedures create the folder for me?<br>> <br>> You need to create the path yourself. As I said: those functions just <br>> return a string. What you do with it, is up to you.<div><br></div><div><div>var</div><div> str1 : string;</div><div>begin</div><div> str1 := GetAppConfigDir( true );</div><div> ShowMessage( Str1 );</div><div> // note: for Fred.exe returns C:\ProgramData\Fred\</div><div> if not DirectoryExists(Str1) then</div><div> // Create Directory Str1</div><div> // call to 'mkdir' ??? what about on Linux??? and other platforms?</div></div><div><br></div><div>What is the cross-platform way for me to create the directory in Str1 (as returned by GetAppConfigDir) ?</div><div><br></div><div>I would assume that I need to ShellExecute a command for 'mkdir' for Windows, correct? How about for Linux and Macs, etc?</div><div><br></div><div>I found this page:</div><div><br></div><div><a href="http://wiki.lazarus.freepascal.org/Executing_External_Programs">http://wiki.lazarus.freepascal.org/Executing_External_Programs</a></div><div><br></div><div>But I have to admit that I was totally lost in what it was trying to explain. </div><div><br></div><div>An example, please?</div><div><br></div><div>Best Regards,</div><div>PEW</div><div><br></div><div>> <br>> Regards,<br>> Sven<br>> <br>> --<br>> _______________________________________________<br>> Lazarus mailing list<br>> Lazarus@lists.lazarus.freepascal.org<br>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus<br></div> </body>
</html>