file-permissions

CodeIgniter - Message: mkdir(): Permission denied on Ubuntu

旧街凉风 提交于 2019-12-02 06:00:31
问题 I'd like some help please. I have this PHP script inside my Post_model constructor $dir = FCPATH . 'uploads' . DIRECTORY_SEPARATOR . 'posts'; if (!is_dir($dir)) { mkdir($dir, 0755, true); } which shows me this error: Severity: Warning Message: mkdir(): Permission denied The main idea is that the project has the ability to create users and these users can upload images, or create folders-albums which are stored in the uploads folder. I've been struggling to fix this error the last days and can

Apache+PHP write permissions on unix

折月煮酒 提交于 2019-12-02 02:26:18
问题 I'm trying to launch PHP site with apache on fedora and I have a problem about writting permissions. It looks like apache does not have write permissions to some folders, but I canno understand why. I've checked httpd.conf and it has group: apache, user: apache. I then made: chown -R apache:apache www and set 777 permissions to the folders, but it still says: Warning: file_put_contents(/var/www/public/temp.txt) [function.file-put-contents]: failed to open stream: Permission denied in /var/www

scanning /home/ with opendir()

血红的双手。 提交于 2019-12-02 02:12:45
问题 Is it possible to scan /home/ directory with opendir and scandir. When i try to exec script it says permission denied what should i do? <?php $dir = '/home/'; $dirs = scandir($dir); ?> <pre> <?php print_r($dirs); ?> </pre> 回答1: You can use is_readable('/home/') to check if you have permission. If not you'd need to make sure the directory has read privileges, probably 0755 (rwxr-xr-x) 回答2: For security, PHP defines a 'basedir', below which you are not allowed to access. As Aleks G says, there

C# - Cannot access all files

谁都会走 提交于 2019-12-02 01:24:06
My application uses the .NET object Directory.GetFiles() The actual overload I'm using is var allFiles = Directory.GetFiles("C:\\Users\\Dave", "*.*", SearchOption.AllDirectories); The issue is when the source folder is C:\Users\UserName as it then tries to look through application data folder. When it tries to read from the application data folder, an exception is thrown: "Access to the path 'C:\Users\Dave\AppData\Local\Application Data' is denied." So, my question is does any one have an opinion as to my options? I would assume I have to either change the way I collect all the files or, there

Checking for file existence in C++

核能气质少年 提交于 2019-12-01 20:16:33
Currently I use something like: #include <sys/stat.h> #include "My_Class.h" void My_Class::my_function(void) { std::ofstream my_file; struct stat file_info; if ( filename_str.compare("")!=0 && stat(filename_str.c_str(),&file_info) == 0 ) { my_file.open(filename_str.data(),std::ios::trunc); //do stuff my_file.close(); } else if ( filename_str.compare("")==0 ) { std::cout << "ERROR! ... output filename not assigned!" << std::endl; } else { std::cout << "ERROR! File :" << std::endl << filename_str << std::endl << "does not exist!!" << std::endl; } } ...is this a decent way to go, or is there a

Debugger can't connect when starting local azure project

懵懂的女人 提交于 2019-12-01 18:44:42
问题 Ok, first of; here's what I did: Install AZURE tools Reboot Start Visual Studio - new Azure project Add web role (asp.net MVC 4 beta web role) Hit F5 (debug) It starts up the storage emulator and the compute emulator and starts to load in runtimes, and then I get a popup saying that the debugger couldn't connect. Then after some googeling I'm suggested to try to run the application without running the debugger to see if I can acces the application. When I do I get this: So I figure that IIS

How to check in Perl if the file permission is greater than 755?

血红的双手。 提交于 2019-12-01 17:41:09
问题 For a unix file, I want to know if Group or World has write permission on the file. I've been thinking on these lines: my $fpath = "orion.properties"; my $info = stat($fpath) ; my $retMode = $info->mode; $retMode = $retMode & 0777; if(($retMode & 006)) { # Code comes here if World has r/w/x on the file } Thanks. 回答1: You are close with your proposal - the usage of stat is a little off (but on second thoughts, you must be using File::stat; it helps if your code is complete), the mask constant

Why is my file supposedly unable to be read due to insufficient permissions (HTTP Error 500.19), when it has no restrictions on it?

好久不见. 提交于 2019-12-01 12:39:13
问题 I'm getting this error when I try to run a ASP.NET site (my first time trying to get it to run): Yet looking at the file implicated (\C:\EnhancedSalesReporting\customerreportingnet\customerreportingnet\web.config), it doesn't seem to have any restrictions / insufficient permissons: What is really the problem here, or what must I do to get beyond this frustrating block? asp.net web.config 500.19 internalservererror configfile insufficientpermissions permissions UPDATE When I approached it

How to create non-read-only directories from Java in Windows

China☆狼群 提交于 2019-12-01 11:51:20
I'm creating directories using myFileObject.mkdirs() . In Windows, every directory that gets created is marked as read-only. Although I can (oddly) still write to the directory, it creates aggravation when it comes to deleting things. Is there some system property or something I can set so that the default permission on new directories is read-write? (I've searched on SO and the web and haven't found anything besides other people complaining about the same thing.) It's a pain to have to call setWritable for a directory tree. (If it makes a difference, I'm using J2SE 1.6.0_23 on Windows 7.) As

How can I allow the TTS to write files to my app's directories?

拥有回忆 提交于 2019-12-01 11:18:07
I want to write output from the TextToSpeech engine to my app's cache directory. In order to for the TTS to write there I first have to give it permissions to do so. But I don't know how. I understand that normally such problems can be solved by handing a FileDescriptor over thus giving permissions to access a specific file. But I can't do that with TTS, as the TextToSpeech.synthesizeToFile method only accepts the file path as a String, no FileDescriptor . So what to do? To make my point that TTS really hasn't permissions to write to my app's directories, here's the code...: TextToSpeech mTts