Hide file or directory using Windows API with C

I want to change the program to C so that some of the files that it creates are hidden in Windows. Which Windows or (even better) POSIX API will set the hidden file attribute?

+5
source share
4 answers

You can do this by calling SetFileAttributes and setting the FILE_ATTRIBUTE_HIDDEN flag. See http://msdn.microsoft.com/en-us/library/aa365535%28VS.85%29.aspx

This is not POSIX. To create a “hidden” file on a regular POSIX system such as Linux, simply run the file name with a dot (.).

+11
source

Windows UNIX- , . UNIX- , , "". , Windows "" .

, POSIX , , ​​ .

Windows SetFileAttributes.

+8

CreateFile FILE_ATTRIBUTE_HIDDEN

+3

GetFileAttributesEx, GetFileAttributes SetFileAttributes API Win32.

+3

All Articles