file-permissions

How to create non-read-only directories from Java in Windows

半世苍凉 提交于 2019-12-01 09:48:48
问题 I'm creating directories using myFileObject.mkdirs() . In Windows, every directory that gets created is marked as read-only. Although I can (oddly) still write to the directory, it creates aggravation when it comes to deleting things. Is there some system property or something I can set so that the default permission on new directories is read-write? (I've searched on SO and the web and haven't found anything besides other people complaining about the same thing.) It's a pain to have to call

Bypass Windows permission restrictions on program files folder

不想你离开。 提交于 2019-12-01 09:14:08
I have made a small application in C. It does some file manipulation, basically searches and changes some files names. But if it is used in Win Vista/7 in the program files folder the program says permission denied. Is there anyway to bypass this? Also, can Java bypass this? There wouldn't be much point to file permissions if they could be easily bypassed. You could bypass them if you wrote a kernel driver that accessed disk blocks directly, but then you need to be an Administrator to install kernel drivers anyway. At the end of the day, the only way to "bypass" file permissions is to run your

Set read permission for certificate from command line

喜你入骨 提交于 2019-12-01 06:56:19
Can anyone point me in the right direction for managing read permissions for certificates from the command line? I'm scripting our certificate installation, and need to allow NetworkService to access 2 certificates in the "Local Computer\Personal\Certificates" store. Thanks in advance I've done that to grant a our web application access to a private key of a cert that was installed in windows. Here's a powershell script. It relies on FindPrivateKey.exe from Microsoft. # Use FindPrivateKey.exe (From Windows SDK) to get the file name of the private key. $s = cmd /c "FindPrivateKey.exe My

Bypass Windows permission restrictions on program files folder

荒凉一梦 提交于 2019-12-01 06:49:13
问题 I have made a small application in C. It does some file manipulation, basically searches and changes some files names. But if it is used in Win Vista/7 in the program files folder the program says permission denied. Is there anyway to bypass this? Also, can Java bypass this? 回答1: There wouldn't be much point to file permissions if they could be easily bypassed. You could bypass them if you wrote a kernel driver that accessed disk blocks directly, but then you need to be an Administrator to

Android - How do I save a file that is readable by an other app?

人走茶凉 提交于 2019-12-01 06:47:34
I want to save a file and then fire an intent to an other application to open that file. How do I accomplish this? If tried : openFileOutput("file.pdf", Context.MODE_WORLD_READABLE) but doesn't seem to work. Should I save the file outside the applications folder? If so how do I pass it the correct permissions? HefferWolf You can use something like this: String extPath = Environment.getExternalStorageDirectory().getAbsolutePath(); String pathPrefix = extPath + "/Android/data/" + APP_PACKAGE_ID + "/cache/"; to save the file to sd card, which is accessible by all other applications. the Mode

C# - Cannot access all files

依然范特西╮ 提交于 2019-12-01 06:34:30
问题 My application uses the .NET object Directory.GetFiles() The actual overload I'm using is var allFiles = Directory.GetFiles("C:\\Users\\Dave", "*.*", SearchOption.AllDirectories); The issue is when the source folder is C:\Users\UserName as it then tries to look through application data folder. When it tries to read from the application data folder, an exception is thrown: "Access to the path 'C:\Users\Dave\AppData\Local\Application Data' is denied." So, my question is does any one have an

Permission issues, not able to run script as root

谁都会走 提交于 2019-12-01 06:25:43
问题 I am running a shell script(Script.sh) which, itself, is calling other shell scripts( Script2.sh, Script3.sh ...etc). I logged in as a root user and have given execution permission to all the scripts. But on when I execute "ls -l" the scripts still dont have execution permissions displayed on file attributes column. "Script.sh" runs by following syntax: root@freescale $ sh Script.sh But this script is not able to execute other scripts(Script2.sh, Script3.sh) being called by it. Error is

Set read permission for certificate from command line

寵の児 提交于 2019-12-01 05:34:45
问题 Can anyone point me in the right direction for managing read permissions for certificates from the command line? I'm scripting our certificate installation, and need to allow NetworkService to access 2 certificates in the "Local Computer\Personal\Certificates" store. Thanks in advance 回答1: I've done that to grant a our web application access to a private key of a cert that was installed in windows. Here's a powershell script. It relies on FindPrivateKey.exe from Microsoft. # Use

php chmod() not changing permissions

纵饮孤独 提交于 2019-12-01 05:17:43
I am having problems with a picture uploading script. I know there are hundreds of the same questions, but I haven't found the one that would be work for me. $upload_dir = "images/postcards/"; chmod($upload_dir, 777); if (is_writable($upload_dir)) { echo 'The file is writable'; } else { echo 'The file is not writable'; } This always returns that the file is "not writable" I tried setting chmod to 0777 and -rwxrwxrwx . But result was always the same. Any Ideas? The directory must be owned by the user invoking the script (typically www-data , apache or httpd if you're running the script in a

File Upload Permission denied Godaddy Shared hosting

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 04:26:53
I have a web application on godaddy shared hosting. Its a asp.net application. Everything working fine but when I upload some file it gives an error "Access to the path 'PATH' is denied." I tried several ways like giving full permission to the folder in which I am uploading the file from godaddy control panel. I also saw this post and tried to follow he said : http://forums.asp.net/t/1052417.aspx/1 But no help. Can anyone suggest me whats wrong there. Its under IIS 7. Follow this: Source - 2 “Setting Directory Permissions with Windows Hosting Accounts” http://support.godaddy.com/help/article