stack_A stack_A - 2 months ago 9
Linux Question

how to create hidden files in linux

in my program I have to create a hidden file in order to avoid remove or modification of file

PATH=/etc/
NAME = file


so I ask if there is function in c which allow to do that ?

thank

Answer

You can just add a . to the front of the file name. Having said that if your goal is to not allow modification of the file change the permissions to something that can't be modified. Something like:

chmod 444 fileName