|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
CommonApplicationData alternativeHi 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@... http://lists.ximian.com/mailman/listinfo/mono-aspnet-list |
|
|
|
|
|
|
|
|
Re: CommonApplicationData alternativeAssuming 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@...> 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@...> 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@...> 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@... >> >> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list >> >> >> > >>_______________________________________________ >>Mono-aspnet-list mailing list >>Mono-aspnet-list@... >>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@... > http://lists.ximian.com/mailman/listinfo/mono-aspnet-list > Mono-aspnet-list mailing list Mono-aspnet-list@... http://lists.ximian.com/mailman/listinfo/mono-aspnet-list |
|
|
|
|
|
Re: CommonApplicationData alternativeNot 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@...> 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@...> 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@...> 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@...> 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@... >> >> >> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list >> >> >> >> >> > >> >>_______________________________________________ >> >>Mono-aspnet-list mailing list >> >>Mono-aspnet-list@... >> >>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@... >> > http://lists.ximian.com/mailman/listinfo/mono-aspnet-list >> > >>_______________________________________________ >>Mono-aspnet-list mailing list >>Mono-aspnet-list@... >>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@... > http://lists.ximian.com/mailman/listinfo/mono-aspnet-list > Mono-aspnet-list mailing list Mono-aspnet-list@... http://lists.ximian.com/mailman/listinfo/mono-aspnet-list |
| Free embeddable forum powered by Nabble | Forum Help |