Good morning everyone. I am still working on my new package manager for Linux. In some case, I need to check if my command line program was run with privilege or not. How can I do that ?
if LibC.getuid == 0
puts "not superuser"
Thank you !
I have another question about that. If my program try to access to a file it don’t have the proper right, how can I know that ?
Depends on your exact use-case but probably one of these:
An exception is thrown. Just rescue it.
Why I didn’t think about that earlier