Changing file permission in Python

os.chmod(path, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) stat The following flags can also be used in the mode argument of os.chmod(): stat.S_ISUID Set UID bit. stat.S_ISGID Set-group-ID bit. This bit has several special uses. For a directory it indicates that BSD semantics is to be used for that directory: files created there inherit their group ID … Read more

file_put_contents – failed to open stream: Permission denied

Try adjusting the directory permissions. from a terminal, run chmod 777 database (from the directory that contains the database folder) apache and nobody will have access to this directory if it is chmodd’ed correctly. The other thing to do is echo “getcwd()”. This will show you the current directory, and if this isn’t ‘/something…/database/’ then … Read more

Retaining file permissions with Git

Git is Version Control System, created for software development, so from the whole set of modes and permissions it stores only executable bit (for ordinary files) and symlink bit. If you want to store full permissions, you need third party tool, like git-cache-meta (mentioned by VonC), or Metastore (used by etckeeper). Or you can use … Read more

How do I change read/write mode for a file using Emacs?

M-x read-only-mode in very old versions of Emacs, the command was: M-x toggle-read-only On my Windows box, that amounts to Alt-x to bring up the meta prompt and typing “read-only-mode” to call the correct elisp function. If you are using the default keyboard bindings, C-x C-q (which you read aloud as “Control-X Control-Q”) will have … Read more

Laravel daily log created with wrong permissions

Laravel version 5.6.10 and later has support for a permission element in the configuration (config/logging.php) for the single and the daily driver: ‘daily’ => [ ‘driver’ => ‘daily’, ‘path’ => storage_path(‘logs/laravel.log’), ‘level’ => ‘debug’, ‘days’ => 7, ‘permission’ => 0664, ], No need to juggle with Monolog in the bootstrap script. Specifically, support was added … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)