[Mono-aspnet-list] CommonApplicationData alternative

william leader william.leader at gmail.com
Fri Oct 30 10:25:32 EDT 2009


Not really, This is more about a difference with the underlying OS. On
windows the Local Application data is automatically created the first
time the user logs in, however on Linux, this directory is not
automatically created. So in both Microsoft .Net, and Mono, the
combination of Environment.GetFolderPath and Environment.SpecialFolder
get a path that the application should use for a specific purpose.
Neither Mono nor Microsoft .Net need to check the existence of these
directories because it is the operating systems job to provide them.

On Fri, Oct 30, 2009 at 2:12 PM, APS <dev.malst at apsystems.it> wrote:
> I'll do that, thanks.
> Btw if we assume that Mono should act like MS.NET thi is a difference :)
>
> At 14.47 30/10/2009, william leader wrote:
>>Assuming that /var/www is the apache user's home directory on your
>>machine, then that user should have permission to create the directory
>>if it doesn't exist. Another option for you is to make the directory a
>>configurable option for your asp application, and let the
>>administrator set it to a directory they like, and setup the
>>appropriate permissions.
>>
>>On Fri, Oct 30, 2009 at 1:38 PM, APS <dev.malst at apsystems.it> wrote:
>> > Thanks for the help.
>> > I tried but LocalApplicationData returns "/var/www/.local/share" that
>> > doesn't exists.
>> >
>> > At 12.15 30/10/2009, william leader wrote:
>> >>I haven't tried this on linux myself, but I would think you would want
>> >>to use .LocalApplicationData which should map to a folder that is
>> >>available to the current user. That should be a directory that the
>> >>apache user should have the required access to.
>> >>
>> >>LocalApplicationData    The directory for application data shared by
>> >>users of the computer. On non-Windows operating systems, this path is
>> >>the value of the environment variable XDG_DATA_HOME if it is set,
>> >>otherwise the ".local/share" directory in the current user's home
>> >>directory.
>> >>
>> >>Have a look here:
>> >>http://www.go-mono.com/docs/index.aspx?link=T%3ASystem.Environment
>> .SpecialFolder
>> >>
>> >>On Fri, Oct 30, 2009 at 11:13 AM, william leader
>> >><william.leader at gmail.com> wrote:
>> >> > I haven't tried this on linux myself, but I would think you would want
>> >> > to use .LocalApplicationData which should map to a folder that is
>> >> > available to the current user. That should be a directory that the
>> >> > apache user should have the required access to.
>> >> >
>> >> > LocalApplicationData    The directory for application data shared by
>> >> > users of the computer. On non-Windows operating systems, this path is
>> >> > the value of the environment variable XDG_DATA_HOME if it is set,
>> >> > otherwise the ".local/share" directory in the current user's home
>> >> > directory.
>> >> >
>> >> > Have a look here:
>> >> >
>> >>
>> http://www.go-mono.com/docs/index.aspx?link=T%3ASystem.Environment.SpecialFolder
>> >> >
>> >> > On Fri, Oct 30, 2009 at 10:37 AM, APS <dev.malst at apsystems.it> wrote:
>> >> >> Hi everyone,
>> >> >>
>> >> >> in MS.NET/Win I was using
>> >> >> System.Environment.SpecialFolder.CommonApplicationData to store data
>> >> >> files but in linux this directory is usually 755 with user root and
>> >> >> the web application runs with apache user so the directory is
>> >> not writable.
>> >> >> Even in windows the directory is writable by admins only but also the
>> >> >> aspnet user has access to it probably cause is in the SYSTEM group.
>> >> >> As I don't want to change access permissions on /usr/share, what is
>> >> >> the correct system directory where to store data from an asp.net
>> >> application?
>> >> >> Thanks in advance.
>> >> >>
>> >> >>
>> >> >> _______________________________________________
>> >> >> Mono-aspnet-list mailing list
>> >> >> Mono-aspnet-list at lists.ximian.com
>> >> >> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>> >> >>
>> >> >
>> >>_______________________________________________
>> >>Mono-aspnet-list mailing list
>> >>Mono-aspnet-list at lists.ximian.com
>> >>http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>> >>
>> >>--
>> >>Il messaggio e' stato analizzato alla ricerca di virus o
>> >>contenuti pericolosi da MailScanner, ed e'
>> >>risultato non infetto.
>> >
>> >
>> > _______________________________________________
>> > Mono-aspnet-list mailing list
>> > Mono-aspnet-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>> >
>>_______________________________________________
>>Mono-aspnet-list mailing list
>>Mono-aspnet-list at lists.ximian.com
>>http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>>
>>--
>>Il messaggio e' stato analizzato alla ricerca di virus o
>>contenuti pericolosi da MailScanner, ed e'
>>risultato non infetto.
>
>
> _______________________________________________
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>


More information about the Mono-aspnet-list mailing list