file-permissions

Writing to the internal private storage in Android

柔情痞子 提交于 2019-11-27 22:24:48
I am trying to save some data from my app in a simple text file on the internal private storage area (app user preferences). I have read through many questions on here (StackOverflow) and tried the solutions suggested with no success. The simplest solution, it seems, would be the one suggested here: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal but I cannot get this to work on my test device. I have also tried to create the file using the methods available in the java.io.File with the appropriate methods. I have also tried to create the file on the SDCard with

Permissions on log files created by log4j RollingFileAppender

不羁的心 提交于 2019-11-27 22:04:49
How are the permissions for files created by RollingFileAppender determined? I recently changed a daemon process I have to be run as a non-root user and the files are now being created with permissions of 0600 (only readable by the owner), but I would like them to be readable by all or at least members of an admin group ( 0644 or 0640 ). Files created by my tomcat apps are always 0644 (readable by all). I don't know if I inadvertently changed something else or if it is something to do with permissions of that user. I made the parent directory 0777 as a test and it didn't seem to help (it was

Copy a file with its original permissions

心已入冬 提交于 2019-11-27 18:34:49
问题 When using the File.Copy() method the file is copied to its new directory however it loses its original permissions. Is there a way to copy a file so that it doesn't lose the permissions? 回答1: I believe you can do something like this: const string sourcePath = @"c:\test.txt"; const string destinationPath = @"c:\test2.txt" File.Copy(sourcePath, destinationPath); FileInfo sourceFileInfo = new FileInfo(sourcePath); FileInfo destinationFileInfo = new FileInfo(destinationPath); FileSecurity

Apache permissions, PHP file create, MKDir fail

只谈情不闲聊 提交于 2019-11-27 17:53:14
It seems i cannot create files. When i set permissions to 777 On the folder i am trying to create a folder in then the script works fine. If the folder is set to 755, it fails. I do not know much about linux, but i am suppose to figure this stuff out. I have spent a couple hours trying stuff. Does anyone know how to make it so that apache has high enough permissions. I know it is a permissions and apache problem, i just do not know how to fix this. I have edited the httpd.conf file, but i really do not know what i am doing... Any help? (I saved backup.) Please stop suggesting to use 777. You

Does git store the read, write, execute permissions for files?

只谈情不闲聊 提交于 2019-11-27 17:35:12
问题 I wanted to make some files in git read only. But I couldn't find any good documentation on doing this. Does git store the read, write, execute permissions for files? 回答1: According to kernel.org git does not store all the permissions possible for files. Git is a content tracker, where content is de facto defined as "whatever is relevant to the state of a typical sourcecode tree". Basically, this is just files' data and "executable" attribute. So git stores only the content in the file and

Git file permissions on Windows

☆樱花仙子☆ 提交于 2019-11-27 16:38:49
I've read through a few questions regarding file permissions in Git and I'm still a bit confused. I've got a repo on GitHub forked from another. Post merge, they should be identical. However: $ git diff --summary origin/epsilon master/epsilon mode change 100644 => 100755 ants/dist/sample_bots/csharp/compile.sh mode change 100644 => 100755 ants/dist/starter_bots/coffeescript/MyBot.coffee mode change 100644 => 100755 ants/dist/starter_bots/coffeescript/ants.coffee mode change 100644 => 100755 ants/util/block_test.sh mode change 100644 => 100755 manager/mass_skill_update.py mode change 100644 =>

Chmod 777 to a folder and all contents [duplicate]

断了今生、忘了曾经 提交于 2019-11-27 16:33:31
This question already has an answer here: How do I change permissions for a folder and all of its subfolders and files in one step in Linux? [closed] 16 answers I have a web directory /www and a folder in that directory called store . Within store are several files and folders. I want to give the folder store and all files and folders within the store folder all permissions. How do I do this? I am guessing via .htaccess. petervaz If you are going for a console command it would be: chmod -R 777 /www/store . The -R (or --recursive ) options make it recursive. Or if you want to make all the files

PowerShell To Set Folder Permissions

久未见 提交于 2019-11-27 15:46:49
问题 I am trying to use the "default" options in applying folder permissions; by that, I mean that using the "Full Controll, Write, Read, etc" in the 'Properties' for a folder. The following script works to add the user in, but it applies "Special Permissions" - not the ones with the tick boxes for the ones visible in the properties menu of the folder: $Acl = Get-Acl "\\R9N2WRN\Share" $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule ("user","FullControl","Allow") $Acl

Check file permissions

泪湿孤枕 提交于 2019-11-27 15:29:01
How can I check file permissions , without having to run operating system specific command via passthru() or exec() ? Use fileperms() function clearstatcache(); echo substr(sprintf('%o', fileperms('/etc/passwd')), -4); You can use the is_readable() , is_executable() etc.. commands. Real coders use bitwise operations, not strings ;) This is much more elegant way of handling permissions: function checkPerms($path) { clearstatcache(null, $path); return decoct( fileperms($path) & 0777 ); } Use fileperms() function and substring: substr(decoct(fileperms(__DIR__)), -4); // 0777 substr(decoct

Having trouble writing to a file with PHP on Ubuntu

不想你离开。 提交于 2019-11-27 15:09:36
问题 I am running PHP 5.5.9 on Ubuntu 14.04. I'm having trouble writing to a file. I feel like this has to be a file permissions problem because I'm pretty sure the code is correct. The user that I'm logged in as has permissions to write in the folders that I am trying to write into, but I'm not sure if the localhost does. I'm not sure what the name of the localhost user is in order to use chmod . I tried using chmod 777 -R /var/www/html and the script is still is not able to write to my target