LCHMOD(3) BSD Library Functions Manual LCHMOD(3)NAME
lchmod -- change mode of file
SYNOPSIS
#include <sys/stat.h>
#include <unistd.h>
int
lchmod(const char *path, mode_t flags);
DESCRIPTION
The function lchmod() sets the file permission bits of the file specified by the pathname path to mode. See chmod(2) for the values of the
flags.
The lchmod() call is like chmod() except when the named file is a symbolic link, in which case lchmod() will change the flags of the link
itself, rather than the file it points to.
NOTE
Instead of being a system call, lchmod() is emulated using setattrlist(2). Not all file systems support setattrlist(2).
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
ERRORS
The lchmod() call may return the same errors as chmod(2) and setattrlist(2).
SEE ALSO chmod(2), setattrlist(2)BSD Oct 31, 2005 BSD
Check Out this Related Man Page
LCHFLAGS(3) BSD Library Functions Manual LCHFLAGS(3)NAME
lchflags -- set file flags
SYNOPSIS
#include <sys/stat.h>
#include <unistd.h>
int
lchflags(const char *path, u_int flags);
DESCRIPTION
The file whose name is given by path has its flags changed to flags. See chflags(2) for the values of the flags.
The lchflags() call is like chflags() except when the named file is a symbolic link, in which case lchflags() will change the flags of the
link itself, rather than the file it points to.
NOTE
Instead of being a system call, lchflags() is emulated using setattrlist(2). Not all file systems support setattrlist(2).
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
ERRORS
The lchflags() call may return the same errors as chflags(2) and setattrlist(2).
SEE ALSO chflags(2), setattrlist(2)BSD Oct 31, 2005 BSD
Dear Experts
How can I change permanently those permission assignment when a file is going to be touched? I don't like use chmod each time I touch a file.
Best Regards
Reza (6 Replies)
i want to run a forum on my site and in the readme file it says you must chmod to 755 but i do not know how to chmod a file can anyone help me??? (2 Replies)
Hey everyone, I was wondering if there was a quicker way to chmod a lot of files than doing what im currently doing.
At the moment, im doing chmod 777 *filename* - but I have a lot of files, sub-directories, sub-files etc etc. And at the moment I see I have to chmod every single file... (3 Replies)
Trying to install something. Can someone explain what this means?
chmod -R a+r .
chmod -R a+w logo.gif tempdir/ templates_c/
I recognize that file permissions are being changed (chmod), but beyond that, it's Greek to me. (6 Replies)
Hi
I have a text file which contains a list of file names (one file name per line). I would like to pass the contents of this file into chmod to change the permissions. I am having trouble getting the correct syntax for this. Can someone please tell me if its possible to do this?
Thanks (2 Replies)
I want to make a hidden file with chmod command.
Example:
I have a file name inputfile.txt
-rw-r--r-- 1 xxxxxx xxxxxx 1388 Sep 12 05:41 inputfile.txt
I want to hide that file using chmod command.
Please tell me if it is possible or there is some other way to do this.
Thanks... (2 Replies)
Hii,
I have a file that is read only file.i want to change the permission of the file remaining inside the file.How can i do that.
i used this
:! chmod 755 %
but it is not doing the desired thing.
Help me out in this. (6 Replies)
Hello,
After, I stat() a file, how can I read the various permissions flags from the st_mode variable which is of type mode_t? I would like to do something like:
struct stat *perms;
int res = stat(filename, perms);
if(perms->st.mode == S_IROTH) do something;
but I know that is the wrong... (2 Replies)
Hi i am transferring the files(around 10000) from the Windows sever to the UNIX server in that i run a command chmod 777 filename.txt
but it is taking a longer time as it gives chmod for each and every file.
So i thouught of giving the permission from the UNIX itself and i tried running
chmod... (2 Replies)
If I:
chmod 740 Documents/
Documents/ = drwxr-----
If I:
chmod 750 Documents/
Documents/ = drwxr-x---
How does that work?
I want to achieve drwxrw---- (5 Replies)
Hi Bros,
I have a question want to receive your help.
On SunOS server. I have 1 file in /etc. mode of file is "read only". I've used chmod 777 commmand to change mode of that file. firstly, it's ok. but about 3 mins after that. The mode of that file rollback to "read only". I don't know how.... (4 Replies)
After much reflecting I decided that I don't want to have a remote managemente in my computer and I digited in Terminal from the Administrator Account:
chmod ug-s /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent
But the answer is: NOT PERMITTED Why? Is it not... (6 Replies)
Oracle Linux 6.4 with bash
Question from a beginner
To change permissions using chmod, I can use 2 methods. Since I don't know the terminology, I am calling them Method1 and Method2.
In the below example, both Method1 and Method2 do the same thing. Which one is you favourite method ?
#... (5 Replies)