hi, i want to know is file/folder is hidden or not, in linux.
i open folder using opendir function, and traverse using readdir function. For every file/folder i want to print it's properties(isFolder, isHidden, ...). I'm using stat() function to get file/folder properties, but i can't find isHidden flag? Where i must look for this flag?
i think i can't explain what i want. i have some c program which prints the contents of some folder. The output format is:
File name:
IsFolder:
IsHidden:
The problem is that i can't find isHidden flag, is directory flag i get from S_ISDIR macros. So i is there some function or macros which gives me this information?
their name starts with a dot .
However you may want to skip the current ./ and the parent ../ directories.
how it is related to my question? i want to know is there some way to know the hidden attribute of file/folder, this code in windows, i want exactly this but in linux, is it possible?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
WIN32_FIND_DATA data;
HANDLE handle;
char path[MAX_PATH] = "C:\\Movies\\*";
handle = FindFirstFile(path, &data);
if(INVALID_HANDLE_VALUE != handle)
{
// I need this code in Linux
bool isHidden = data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN;
}
i have one more question, it is about readdir function, i create little program, which prints the number of children(folders/files) of the folder. But when i run program and compare results with results of explorer properties, they are different. I guess explorer doesn't count system files, but my program does. So my question, what i must do to get the same results as linux explorer?