file-permissions

Overwrite existing XML file if it alreadly exists

点点圈 提交于 2019-12-10 18:45:59
问题 I am trying to overwrite an existing xml file if it already exists. I am using the code below to check if the file exists and then overwrite it if it does. The existing file is hidden so I am unhiding it before attempting to overwrite. The changes are not occuring to the file and the overwriting is not working however. Here is the code I am using below minus the part where I am writing the new xml data. if(File.Exists(filePath)) { File.SetAttributes(filePath,FileAttributes.Normal);

FileSystemWatcher - minimum permissions needed on target directories?

大憨熊 提交于 2019-12-10 18:44:34
问题 Using the .NET FileSystemWatcher http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx to monitor a directory full of files for : Changed; Created; Deleted; Renamed events . What's the minimum the rights the Account running the FileSystemWatcher needs over the directory it's watching ? It seems like it would be READ but I can't find that documented anywhere. Thanks 回答1: The underlying API is ReadDirectoryChangesW. The only thing mentioned in the MSDN Library article for it

How do I give apache permission to use a directory on an NTFS partition?

戏子无情 提交于 2019-12-10 18:09:49
问题 I am running Linux (Lubutu 12.10) on an older machine with a 20GB hard drive. I have a 1 TB external hard drive with an NTFS partition on it. On that partition, there is www directory that holds my web content. It is auto-mounted at startup as /media/t515/NTFS. I would like to change the apache document directory from /var/www to /media/t515/NTFS/www. I need to keep the partition as an NTFS partition, because I use the same hard drive on a different machine running WAMP. I changed the file

Linux file permission

喜欢而已 提交于 2019-12-10 16:19:49
问题 There is a process which is running under root user. ps aux | grep ProcessX root 11565 0.0 0.7 82120 22976 ? Ssl 14:57 0:02 ProcessX Now ls -l /proc/11565/ (pid ) gives this result. total 0 dr-xr-xr-x 2 root root 0 Aug 9 16:06 attr -rw-r--r-- 1 root root 0 Aug 9 16:06 autogroup -r-------- 1 root root 0 Aug 9 16:06 auxv -r--r--r-- 1 root root 0 Aug 9 16:06 cgroup --w------- 1 root root 0 Aug 9 16:06 clear_refs -r--r--r-- 1 root root 0 Aug 9 16:06 cmdline -rw-r--r-- 1 root root 0 Aug 9 16:06

Make all new directories have 777 permissions

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 14:42:10
问题 I have a script that, when run, creates a directory inside /home/test/ and then writes some files in it. When I run this script, it works fine. However, when I call it from a perl script with $ret = `/home/..../testscript.py` it doesn't have permissions so it can't create the folder, or can't write inside it after it is created. It looks like when Python does open("/home/test/abcde/file1.txt", "w") , that file has permissions -rw-r--r-- What can I do to get around this? Is there a way to set

Setting the umask of the jenkins process

大兔子大兔子 提交于 2019-12-10 12:47:03
问题 Our jenkins CI server (v1.499) runs tests that call URLs on the CI machine. The applications behind those URLs change the same temporary files as the unit test processes change, so those files need to be group writable. I fixed that for apache already, but totally fail with jenkins. Modifying /etc/default/jenkins to include an umask 002 command does not help. I'm checking that with gdb after restarting the service. So how can I change jenkins' umask setting? 回答1: Set the umask by configuring

How to use AccessController in android?

别说谁变了你拦得住时间么 提交于 2019-12-10 11:36:53
问题 In an Android application (API level 10),I do not use below permission in manifest : <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> So application would not write on root of external storage.But when I try to check read/write permission via AccessController by this code: File f = Environment.getExternalStorageDirectory(); String path = f.getAbsolutePath(); String actions = "read,write"; try { AccessController.checkPermission(new FilePermission(path, actions));

java.io.IOException: Permission denied in Java

百般思念 提交于 2019-12-10 10:39:10
问题 I am trying to create a file into the same folder in my project, but I am not able to create that file dynamically. I am trying this: try { System.out.println("path"+System.getProperty("user.dir")); File file = new File("/textfile.txt"); file.createNewFile(); //file.createNewFile(); } catch (Exception e) { e.printStackTrace(); } What I am getting error is this: java.io.IOException: Permission denied Any suggestion will be welcomed. 回答1: To create a File into the same folder in your project,

PHP fails to chmod?

谁都会走 提交于 2019-12-10 10:07:12
问题 I'm running PHP 5.3.5-1ubuntu7.2 (with safe_mode = Off ) and I'm unable to correctly set the mode for any file or directory from within a PHP script, I coded the following test (just to make sure): $result = array(); if (mkdir('./I/do/not/exist/', 0777, true) === true) { $result['./I/'] = sprintf('%s (%s)', getFileOwner('./I/'), getFilePermissions('./I/')); $result['./I/do/'] = sprintf('%s (%s)', getFileOwner('./I/do/'), getFilePermissions('./I/do/')); $result['./I/do/not/'] = sprintf('%s (%s

How can I get the default file permissions in Python?

懵懂的女人 提交于 2019-12-10 03:59:41
问题 I am writing a Python script in which I write output to a temporary file and then move that file to its final destination once it is finished and closed. When the script finishes, I want the output file to have the same permissions as if it had been created normally through open(filename,"w") . As it is, the file will have the restrictive set of permissions used by the tempfile module for temp files. Is there a way for me to figure out what the "default" file permissions for the output file