Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lchmod(3) [osx man page]

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
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Created FilePermission

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)
Discussion started by: Reza Nazarian
6 Replies

2. UNIX for Dummies Questions & Answers

run a forum

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)
Discussion started by: hans vink
2 Replies

3. UNIX for Dummies Questions & Answers

chmod...

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)
Discussion started by: mo0ness
3 Replies

4. UNIX for Dummies Questions & Answers

Need Help Understanding a Unix Command

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)
Discussion started by: chris86
6 Replies

5. UNIX for Dummies Questions & Answers

How Do I Make My wesite available to view?

I think it is something like chmod ... but after that i am lost (2 Replies)
Discussion started by: awesomeaustin75
2 Replies

6. UNIX for Dummies Questions & Answers

chmod - pass a filelist as a parameter?

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)
Discussion started by: alangibson
2 Replies

7. Shell Programming and Scripting

change file type to hidden using chmod command

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)
Discussion started by: rinku
2 Replies

8. Shell Programming and Scripting

need one help

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)
Discussion started by: namishtiwari
6 Replies

9. Programming

How to read flags from mode_t type?

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)
Discussion started by: pallak7
2 Replies

10. Shell Programming and Scripting

Paramater list too long while chmod

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)
Discussion started by: Codesearcher
2 Replies

11. UNIX for Dummies Questions & Answers

chmod -R recursive flag

Hi, why can't I use the flag -R recursive ? ftp> chmod -R a+xwr kickstart usage: chmod mode remote-file ftp> chmod a+xwr kickstart 200 SITE CHMOD command successful thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

12. Linux

chmod will not drwxrw----

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)
Discussion started by: Kolusion
5 Replies

13. Solaris

chmod command in SunOS

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)
Discussion started by: hikaru022002
4 Replies

14. UNIX for Dummies Questions & Answers

chmod ug-s /System/Library/CoreServices/RemoteManagement/ARDAgent.app/.... NOT PERMITTED

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)
Discussion started by: Vera
6 Replies

15. UNIX for Dummies Questions & Answers

The professional way to use chmod ?

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)
Discussion started by: omega3
5 Replies