clinuxhidden-files

How to create hidden files in Linux?


In my program, I have to make a file hidden in order to avoid removal or modification of the file.

PATH=/etc/
NAME = file

Is there a function in C that will allow me to do that?


Solution

  • 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