Re: Packing a C# project.

"Isak Savo" <[email protected]>
Newsgroups gmane.comp.autopackage.devel
Message-ID <[email protected]>
On Tue, Jun 10, 2008 at 9:11 PM, Neil Munro <[email protected]> wrote:
>
> Question
>
>                 // Create the whitelist file.
>                 if ( sTemp == "w" )
>                 {
>                     if ( !File.Exists( Path.Combine( BinReloc.DataDir,
> "whitelist.txt" ) ) )
>                     {
>                         File.Create( Path.Combine( BinReloc.DataDir,
> "whitelist.txt" ) );
>                     }
>
>                     vEditFilter( "white" );
>                 }
>  To do something like the above should it work like this:
>
>                 // Create the whitelist file.
>                 if ( sTemp == "w" )
>                 {
>                     if ( !File.Exists( Path.Combine( BinReloc.DataDir,
> "whitelist.txt" ) ) && !File.Exists( "../share/whitelist" ) )
>                     {
>                         File.Create( Path.Combine( BinReloc.DataDir,
> "whitelist.txt" ) );
>                     }
>
>                     vEditFilter( "white" );
>                 }
> Just a bit confused and wondering if my checks are in the right places.

No no no! Never assume you have write access to the datadir. On linux
and other unix systems you are only allowed to write to the users home
directory. The datadir location should be considered read only, even
for the root user (it could actually be on a read-only filesystem)

You can get the home directory from the system by calling:
string homeDir =
Environment.GetSpecialFolder(Environment.SpecialFolder.Personal);

-Isak

---------------------------------------------------------------------
To unsubscribe, e-mail: autopackage-dev-unsubscribe-OfajU3CKLf1/[email protected]
For additional commands, e-mail: autopackage-dev-help-OfajU3CKLf1/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.