file-permissions

QFileInfo vs QFile to test if a file is writable

自作多情 提交于 2019-12-23 10:25:51
问题 I'm using PyQt and I noticed strange behavior when testing my application with Windows (everything is working as expected with Linux). I have a file that I can read and write and I want to test it from the app: >>> from PyQt4.QtCore import QFile, QFileInfo >>> f1 = QFileInfo("C:\Users\Maxime\Desktop\script.py") >>> f2 = QFile("C:\Users\Maxime\Desktop\script.py") >>> f1.isWritable() True >>> f2.isWritable() False So it looks like QFile is wrong on that test case. But, on another file that is

Cygwin chmod 777 command made other users 'access denied' in Windows 7

南笙酒味 提交于 2019-12-23 05:22:19
问题 I am administrator of a Windows 7 system, created some spreadsheets (.CVS files) and changed the permission of those files by CHMOD 777 command (from CYGWIN console), so that other users can get full access to read and write. But, after the permission changed to (chmod 777), other users (non administrators) can't get access to those files, it errors 'access denied'. In the recent past, I did similar file permission change in Windows XP without any problem, why it is happening in Windows 7 ?

copying file to a directory(c: or c:program files) that i dont have permission [duplicate]

孤街醉人 提交于 2019-12-23 04:15:26
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Allow access permission to write in Program Files of Windows 7 okay, here is my code : System.IO.File.WriteAllBytes(path1, path2); however, there is a problem. user(windows 7 users dont have permission to copy file to c: by default)(...i mean for programs...) therefore, program fails. if user gives permission to copy file in c: program works fine. but you cant tell every user " go to permission.........." so how

WinSCP .NET assembly - How to set folder permissions after creating directory?

南楼画角 提交于 2019-12-23 04:01:08
问题 I'm building a web site and I want that when a user registers, to create a directory on the SFTP server and put in that directory a new file I'm using WinSCP .NET assembly, and writing C#. I noticed that you are able to set permissions only in the method: Session.PutFiles and not in the method: Session.CreateDirectory Snd so after I create the directory and put the file in it, I cannot access the file because I don't have permissions - I'm accessing the file with the full URL How can I access

Set permissions for directory and child items

爷,独闯天下 提交于 2019-12-23 03:35:09
问题 My program to copy some directory, with subdirectories and files from server to local computer. I need, each local user can to modify it (edit/delete/remove/rename). But now it can do owner only. How can I set necessary permissions for copied directory, and its child items? I try such code: String account = Path.Combine(Environment.MachineName, "Users"); FileSystemRights rights = FileSystemRights.FullControl; AccessControlType controlType = AccessControlType.Allow; DirectorySecurity security

How to check for read permission using JSch with SFTP protocol?

折月煮酒 提交于 2019-12-22 10:57:44
问题 I know there is getPermissions() method but I don't know how to use it. How can I check using JSch, if user can read files? 回答1: First, you should generally ask a functional question (what do you want to achive), to get an useful answer. You ask for an implementation/technical detail, hence my possibly useless technical answer: SftpATTRS.getPermissions() returns numerical representation of *nix permissions: https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation It's on its own

Git changes the permissions on a single file unexplainably

寵の児 提交于 2019-12-21 17:01:35
问题 I am the only person involved with this git project. Every time I edit files at my local Ubuntu repository, then push to Bitbucket and pull to my production repository, git changes the edited files to -rwxrwxr-x 775. Apache doesn't like this. Local system: git version 1.8.1.2 on Ubuntu Linux Production system: git version 1.7.12 on CentOS/Red Hat Linux When I fix permissions to 755, then do git diff or git diff -p It shows nothing. At my local repository, the permissions are 755 and the files

Wrong file permission when using git pull in a hook

你离开我真会死。 提交于 2019-12-21 16:54:00
问题 I have created the following git hook to update my web application when new changes are pushed to the repository #!/bin/sh #Update the server version to HEAD echo "Updating webapp..." unset $(git rev-parse --local-env-vars) (cd /var/www/webapp && git pull -q) However, if I add new files they get the wrong permissions. They are only readable by the owner and not by the group or by other users. But I need them to be readable by everyone. Locally they have the right permission bits. And even

function.fopen: failed to open stream: Permission denied in PHP

僤鯓⒐⒋嵵緔 提交于 2019-12-21 16:49:42
问题 I'm trying to create XML sitemaps for my website from my PHP application. The idea is to either create a new file or overwrite an existing file. When I call fopen, I get the following error: [function.fopen]: failed to open stream: Permission denied I'm trying to write to the webroot and its permissions are: 755. This means that the owner has write permission, right? What do I need to do to make my script be able to write to this folder? 777 would be a bad thing, right? Can I run my script as

PHP chmod( ):Operation not permitted, safe_mode deprecation involved?

梦想与她 提交于 2019-12-21 07:24:12
问题 I'm struggling a bit to grasp the concept of chmod() from PHP as the course I'm currently taking is a bit outdated and involves safe_mode. It states that as safe_mode is turned off, the restrictions to modify permissions with chmod() to a file when the owner is not the same as the one executing the command are removed. I'm working with PHP 5.5.9 in conjuncture with XAMPP, I've verified that the flags are turned off (just in case), but can't seem to get it working. As I execute the following