file-permissions

shutil.rmtree fails on Windows with 'Access is denied' [duplicate]

烈酒焚心 提交于 2019-11-27 03:00:43
This question already has an answer here: Deleting directory in Python 6 answers In Python, when running shutil.rmtree over a folder that contains a read-only file, the following exception is printed: File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26\lib\shutil.py", line 216, in rmtree rmtree(fullname, ignore_errors, onerror) File "C:\Python26

Nodejs File Permissions

早过忘川 提交于 2019-11-27 02:08:20
问题 In Node the fs.stat method returns an fs.Stats object right, and I can get the file permission through the fs.Stats.mode property. Here is a real output from both node and shell for the same directories: node shell 17407 d rwx rwx rwt 16877 d rwx r-x r-x 16749 d r-x r-x r-x 16832 d rwx --- --- I need to know how to parse the fs.Stats.mode number to get the permissions. Answer The number is in octal numeric system, after converting to decimal looks like this: 17407 41777 d rwx rwx rwt 16877

how to change the ACLs from c++?

大城市里の小女人 提交于 2019-11-27 02:01:08
问题 How to change the ACLs from c++? Can anyone help me to do the following from c++ without any confirmations: cacls c:\personal\file.txt /d everyone 回答1: Use following code #include <Accctrl.h> #include <Aclapi.h> void SetFilePermission(LPCTSTR FileName) { PSID pEveryoneSID = NULL; PACL pACL = NULL; EXPLICIT_ACCESS ea[1]; SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY; // Create a well-known SID for the Everyone group. AllocateAndInitializeSid(&SIDAuthWorld, 1, SECURITY

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

扶醉桌前 提交于 2019-11-27 01:18:53
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 added the appropriate permissions to the manifest file. I also wrote a test to see which directories

Effective file permissions tool's api in windows

≯℡__Kan透↙ 提交于 2019-11-26 23:31:52
问题 Starting from Windows Server 2003, Windows included a new tool which calculates the effective permissions for a user (basically it resolves all groups access and takes care of all "deny" permissions as well). An example in point is that a user A belongs to groups B and C. B has been denied read permissions on a file F, while C has been allowed read and write permissions on the file and I want to calculate the effective permissions user A has on file F. This tool is available on Windows Server

Laravel daily log created with wrong permissions

纵然是瞬间 提交于 2019-11-26 23:24:52
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 or touches it to make sure it has the right permission everyday, but I'm looking for a better solution

Taking ownership of files with 'broken' permissions

Deadly 提交于 2019-11-26 23:09:20
问题 I'm trying to overcome the following situation. Given a directory stored on an NTFS volume, where: The directory owner is set to someone else (a non-privileged user for example) The directory DACL is configured to permit access to a specific group of people that does not include the system or Administrators The DACL on the directory actually grants no one access to either take ownership or change the DACL (or in short, the all administrators have been locked out of the folder) But! The

NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native)

倾然丶 夕夏残阳落幕 提交于 2019-11-26 22:26:18
I am stuck with this error no matter what directory I am in, and what I type after "npm" in cmd.exe. Here is the npm-debug.log: 0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js' ] 2 info using npm@2.14.12 3 info using node@v4.2.6 4 verbose stack Error: EISDIR: illegal operation on a directory, read 4 verbose stack at Error (native) 5 verbose cwd C:\Users\me 6 error Windows_NT 6.1.7601 7 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\

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

元气小坏坏 提交于 2019-11-26 21:56:52
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 This, apparent default permissions setting, will happen regardless if the user installs the application as

Is possible to set System DateTime from my Android App?

主宰稳场 提交于 2019-11-26 21:47:38
问题 I want to set system clock by SystemClock.setCurrentTimeMillis , but met following error: "Unable to open alarm driver: Permission denied" Below is the Description of setCurrentMillis API from Android Developers Site: public static boolean setCurrentTimeMillis (long millis) Since: API Level 1 Sets the current wall time, in milliseconds. Requires the calling process to have appropriate permissions. Returns if the clock was successfully set to the specified time. So, Application Needs to obtain