file-permissions

Git is changing my file's permissions when I push to server

99封情书 提交于 2019-11-26 11:06:05
问题 I am using git to manage a website on a server. I have a local repository shown below local@workstation:myapp$ ls -l | awk \'{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(\"%0o \",k);print}\' total 16 755 drwxr-xr-x@ 18 thomas staff 612 Jun 13 15:35 application 755 drwxr-xr-x@ 11 thomas staff 374 Jun 12 16:25 assets 644 -rw-r--r--@ 1 thomas staff 6399 Jun 22 11:45 index.php 755 drwxr-xr-x@ 10 thomas staff 340 May 14 15:22 system I have a bare repository on the

Automatically apply “git update-index --chmod=+x” to executable files

半世苍凉 提交于 2019-11-26 10:24:58
问题 I frequently add bash scripts to my git repository, and the scripts have executable permissions in the linux filesystem prior to the git add . But after pushing the added files to a remote repository and pulling in another location, the files show up with non-executable permissions. There seem to be two ways to correct the problem: 1. chmod u+x $script git commit -am \"fixing the script permissions... again...\" or 2. git update-index --chmod=+x $script Instead of fixing up the permissions

java.security.AccessControlException: Access denied (java.io.FilePermission

橙三吉。 提交于 2019-11-26 09:54:33
问题 final File parentDir = new File(\"S:\\\\PDSPopulatingProgram\"); parentDir.mkdir(); final String hash = \"popupateData\"; final String fileName = hash + \".txt\"; final File file = new File(parentDir, fileName); file.createNewFile(); // Creates file PDSPopulatingProgram/popupateData.txt I am trying to create a file in a folder but I am getting exception as java.security.AccessControlException: Access denied I am working in windows environment. I can create a folder from the Windows Explorer,

mkdir() works while inside internal flash storage, but not SD card?

↘锁芯ラ 提交于 2019-11-26 09:36:47
问题 I am currently building a file management app that allows the user to browse the file system of their device. The user starts off in the root directory / of their device, but can browse to any location they want such as the internal flash storage or SD card. One of the critical requirements of this app is to allow the user to create new folders anywhere. A feature like this would be immensely useful for the app. However, the File#mkdir() method does not work at all in the SD card directory. I

What user do python scripts run as in windows? [duplicate]

喜欢而已 提交于 2019-11-26 09:34:19
问题 This question already has answers here : Deleting directory in Python (6 answers) Closed 4 months ago . I\'m trying to have python delete some directories and I get access errors on them. I think its that the python user account doesn\'t have rights? WindowsError: [Error 5] Access is denied: \'path\' is what I get when I run the script. I\'ve tried shutil.rmtree os.remove os.rmdir they all return the same error. 回答1: We've had issues removing files and directories on Windows, even if we had

Permission denied on accessing host directory in docker

廉价感情. 提交于 2019-11-26 09:05:07
问题 In short: I am trying to mount a host directory in Docker, but then I can not access it from within the container, even if the access permissions look good. The details: I am doing sudo docker run -i -v /data1/Downloads:/Downloads ubuntu bash and then ls -al It gives me: total 8892 drwxr-xr-x. 23 root root 4096 Jun 18 14:34 . drwxr-xr-x. 23 root root 4096 Jun 18 14:34 .. -rwxr-xr-x. 1 root root 0 Jun 18 14:34 .dockerenv -rwx------. 1 root root 9014486 Jun 17 22:09 .dockerinit drwxrwxr-x. 18

What do I use on linux to make a python program executable

戏子无情 提交于 2019-11-26 08:14:06
问题 I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux. 回答1: Just put this in the first line of your script : #!/usr/bin/env python Make the file executable with chmod +x myfile.py Execute with ./myfile.py 回答2: If you want to obtain a stand-alone binary application in Python try to use a tool like py2exe or PyInstaller. 回答3: You can use PyInstaller. It generates a build dist so you can execute it as a single "binary" file

How to give Read/Write permissions to a Folder during installation using .NET

对着背影说爱祢 提交于 2019-11-26 08:08:19
问题 I have a Setup project that I have build using Visual Studio 2010. The installer works fine in terms of installing the application and all its dependencies into their proper sub directories and Program Data directories. However, I noticed that each directory (the root folder and all of its sub directories) that the installer created does not give \"Write\" permissions. The only permissions that are added to the directories for the \"Users\" group are: Read & Execute List folder contents Read

Laravel daily log created with wrong permissions

随声附和 提交于 2019-11-26 07:53:47
问题 I have a script that I run using php artisan (with root user), and sometimes it causes the daily log file to be created before the apache www-data user does - which means that when a real user uses my web application, I get the folder permission error: Failed to open stream: Permission denied I change the permissions back to www-data everytime but I want to solve this by having the log file always created with the correct permissions. I\'ve considered creating a cron job that creates the file

Changing file permission in Python

跟風遠走 提交于 2019-11-26 07:28:40
问题 I am trying to change permission of a file access: os.chmod(path, mode) I want to make it read-only: os.chmod(path, 0444) Is there any other way make a file read-only? 回答1: 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