Open SooChang-Lee opened 11 months ago
Can you use the GetFileAttributes
function in package:win32
to get this information?
@brianquinlan hello. I found out about the win32 package this time.
If I run the GetFileAttributes function using this package, can I get the information I need?
how can I run the GetFileAttributes function from my dart code? I couldn't find any example code...
@brianquinlan I succeeded in extracting the FILE_ATTRIBUTE_READONLY attribute using the GetFileAttributes function and was able to check whether the file or directory was hidden.
I think these functions should be provided through dart's File API.
@brianquinlan on macOS checking for a leading dot is not enough. st_flags
should also be checked for UF_HIDDEN
.
I am developing a cross-platform (android, ios, windows, macos, linux) file explorer with flutter.
When showing the file list, hidden files must be shown or hidden depending on the user's selection.
OS's other than windows allow files and folders starting with dot to be identified as hidden files, but windows does not.
The FileSystemEntity, File, and Directory classes do not provide an isHidden property.
I tried using the code below in Windows, but it works differently than expected on USB storage or network volumes. bool isHidden = (stat.mode & 0x02) != 0;
We need a property that can check whether a File or Directory is hidden.
macOS
Windows10