chmod

Get file permissions in Android (root)

冷暖自知 提交于 2019-12-10 10:24:17
问题 After some play around with rooted devices, I got stuck on the files. Let's say we have a file somewhere in the root folder which I want to read/write from my application. The only way I found so far is changing the file permission like String [] cmd = { "su", "-c", "chmod", "777", path}; Process process = new ProcessBuilder(cmd).start(); process.waitFor(); This works fine, the problem is that I want to return back the original file permissions after I'm done with it. Can anybody help me with

How to manage Linux file permissions in Java?

半腔热情 提交于 2019-12-10 10:09:28
问题 Is there any mechanism to get and set the file/directory permissions? For example, I want to show the permisssions of a file in a shell way: -rwxr-xr-- Is it possible to do this using Java? I know that there are some methods in the File class to know if the file canExecute , canRead and canWrite , but AFAIK this info is for the current user only. I need to know the whole octal number, for example 755, so I need to get it from the user, from group and from others. I know that Java7 brings

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 give permissions to specific folders on heroku?

守給你的承諾、 提交于 2019-12-10 05:52:48
问题 I'm trying to install thelia on heroku, but I've problems with permissions on folders. How can I make chmod in the right way? Here is our buildpack: https://github.com/fzaffo/heroku-buildpack-php/blob/master/bin/compile we're getting this result: chmod: cannot access ‘/app/cache’: No such file or directory (seems it can't find folders in /app) Here's the test: http://eglaan.herokuapp.com Thanks for support. 回答1: You need to include composer.json and shoot the chmod command from there: {

How does chmod work for windows? [closed]

主宰稳场 提交于 2019-12-10 04:29:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Windows file permissions are quite different from *nix permissions, so how is chmod from GnuWin coreutils implemented in windows? 回答1: Unless I misread your question, I think this is really a serverfault question. But assuming this is really about the programming involved in implementing POSIX-compliant chmod in

linux常用命令

旧巷老猫 提交于 2019-12-10 01:27:07
一、 文件赋权限 1、加最高权限 chmod 775 文件名 2、加可执行权限 chmod +x 文件名 chmod是权限管理命令change the permissions mode of a file的缩写。 u代表所有者,x代表执行权限。 + 表示增加权限。 chmod u+x file.sh 就表示对当前目录下的file.sh文件的所有者增加可执行权限。 二、修改系统编码 1 英文改中文 设置为中文: a. 修改i18n文件 [root@xqsj-beta ~]# vim /etc/sysconfig/i18n LANG="zh_CN.UTF-8" [root@xqsj-beta ~]# source /etc/sysconfig/i18n b. 修改profile文件 [root@xqsj-beta ~]# vim /etc/profile ...... export LC_ALL="zh_CN.GBK" export LANG="zh_CN.GBK" [root@xqsj-beta ~]# source /etc/profile 查看系统编码: [root@xqsj-beta ~]# locale 2 中文改英文 设置为英文: [root@xqsj-beta ~]# vim /etc/sysconfig/i18n LANG="en_US.UTF-8" [root

linux—chmod

怎甘沉沦 提交于 2019-12-10 00:28:39
chmod -options -c 只输出被改变的文件信息    -f , --silent, --quite 当chmod不能改变文件模式时,不通知用户    -R 递归    -v 无论修改,输出每个文件的信息 用户: u: 用户 g: 组用户 o: 其他用户 a: 所有用户 来源: https://www.cnblogs.com/yuuuukii/p/12014293.html

How to get “drwx---r-x+” folder permission using CHMOD? - Bash script [closed]

♀尐吖头ヾ 提交于 2019-12-09 10:50:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am facing a problem when moving some files across my network and seems to be caused by file permissions. Currently I have folders with this permissions drwxrwxrwx. I need to run a bash script that change permissions to drwx---r-x+ ACL needs to be there. I don't quite understand how can I achieve the same

atlas

半世苍凉 提交于 2019-12-08 19:49:37
需要先授权,不然启动不来 [root@m target]# cd hbase/bin/ [root@m bin]# ./hbase shell bash: ./hbase: Permission denied [root@m bin]# sudo chmod -R 777 . [root@m bin]# cd ..\ > ^C [root@m bin]# cd .. [root@m hbase]# sudo chmod -R 777 . [root@m hbase]# cd .. [root@m target]# cd solr [root@m solr]# ls bin CHANGES.txt contrib dist docs example licenses LICENSE.txt LUCENE_CHANGES.txt NOTICE.txt README.txt server [root@m solr]# cd bin [root@m bin]# sudo chmod -R 777 . [root@m bin]# cd .. [root@m solr]# sudo chmod -R 777 . [root@m solr]# cd bin [root@m bin]# ./solr status Found 1 Solr nodes: Solr process 36852

centos7 虚拟机 A start job is running for /etc/rc.d/rc.local Comp。。。

懵懂的女人 提交于 2019-12-08 19:39:28
一直卡这 F5查看日志,最后一行出现A start job is running for /etc/rc.d/rc.local Comp。。。 原因是rc.local权限设错了 解决方法: 1.进入单用户模式: https://www.cnblogs.com/junjind/p/8993420.html 2.进入 /etc/rc.d/rc.local 修改权限 我是这样改的:chmod a-x rc.local 3.修改权限时出现:chmod: changing permissions of ‘…’: Read-only file system 如果是系统文件,那就重新挂载 mount -rw -o remount / ,其他系统参考下面 解决方案: https://blog.csdn.net/zhangpeterx/article/details/83928344 好了,这样就可以正常启动了 来源: https://www.cnblogs.com/WalkOnMars/p/12006800.html