changing ownership of 'file name' : operation not permitted
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
changing ownership of 'file name' : operation not permitted
I`ve been given a project to design a program that will interface with a hardware device through the parallel port.And so far it`s not going go.
I managed to write the programe an compiled it, but when runing it the compiler says: 'changing ownership of'and then the file name then it continues to say, 'operation not permitted'.
Guys please help!
[QUOTE=Virgil B;4127146]I`ve been given a project to design a program that will interface with a hardware device through the parallel port.And so far it`s not going go.
I managed to write the programe an compiled it, but when runing it the compiler says: 'changing ownership of'and then the file name then it continues to say, 'operation not permitted'.
Im using a LINUX G++ compiler, what version i don`t know,and im using the command
su
{enter possword}
chown root:root scriptname
chown 4755 scriptname
and I saved as an .c file
PLEASE DONT BE TO HARD ON ME GUEST IM NEW ON THIS PROGRAMMING ENVIRONMENT,EXPLAIN AS CLEARLY AS POSSIBLE.
I ONLY KNOW A HAND FULL ABOUT PROGRAMMING AND ITS LANGUAGES
Hello!
Virgil, segfaults are usually signs that you have escaped allowed address range due to programming mistakes or other false assumptions. I.e. you address null pointer (quite typical) and so on.
AFAIK, to check parallel port you just need to send something to it
through command line interface like this:
echo -e "\\033E" > /dev/lp0
HP LJ/DJ should eject a paper sheet (reset itself), Epson will just switch bold font on so it's all harmless for a printer.
If this all works, 100% you've got something wrong in your program.
[QUOTE=Virgil B;4127185]
Quote:
Originally Posted by Virgil B
I`ve been given a project to design a program that will interface with a hardware device through the parallel port.And so far it`s not going go.
If you are using g++ asumming you are coding in c++ you need to save your file as .cpp saving the file with .c is used for c language and not c++. If you are coding C language then you need to use gcc and save as .c
Good luck to u
Note
man g++
That will give you the man page and give you some command to tell version etc.
If you are running the program as root then the process real uid will be root uid. But to determine what resources the process can access effective uid is used. I think in your case effective uid is not privileged to change the ownership of the file(On most of the system only root can change the ownership)
You can make sure by printing the real uid and effective uid of the process (getuid(),geteuid()).
If the process effective uid is not equal to root uid then try setting effective uid to root uid(seteuid())
It would probably be helpful if you could be more specific about when you get the error, where the file lives, etc. So perhaps run the commands you listed above, and then copy/paste everything from the terminal into a post here. The basic rule is: The more information you give, and the more specific it is, the easier it is to help you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.