ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Hi, I planned to make a program to change the local date and time of my machine permanently (just like in yast). So if I rebooted it after changing the date & time with that application, it will be the current date & time of the machine. But the truth is I don't know how. Can anybody help me? Thanks a lot.
Thanks. FYI, I'm trying make a simple GUI for changing the time with SDL & SDL ttf. One more thing though, it seems like hwclock can only be called from root. But I needed everyone to be able to change the date and time with my application. How do I do that?
If you're trying to allow any low-end user to change the time using an executable runnable to only root, you have several options:
Option 1: In the installation/setup procedures, "chmod" the hwclock executable so it can be executed by all (eg. "chmod a+x /path/to/hwclock").
Option 2: Utilize "sudo".
Option 3: Force the user to provide the root password if they wish to apply any changes they've made.
There's more than likely a reason why the executable has default permissions of being root-only, and it's more than likely best not to tamper with it; if you need to be root to run it, there's a reason for it. This is UNIX/Linux, not Windows.
If you're trying to allow any low-end user to change the time using an executable runnable to only root, you have several options:
Option 1: In the installation/setup procedures, "chmod" the hwclock executable so it can be executed by all (eg. "chmod a+x /path/to/hwclock").
Option 2: Utilize "sudo".
Option 3: Force the user to provide the root password if they wish to apply any changes they've made.
There's more than likely a reason why the executable has default permissions of being root-only, and it's more than likely best not to tamper with it; if you need to be root to run it, there's a reason for it. This is UNIX/Linux, not Windows.
Thanks. Will do that. Yeah, I know it's Linux, but I needed it to behave more like a Windows nevertheless. The requirement needed so.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.