Closed zhongshao closed 4 years ago
Please rephrase your question, it is hard to comprehend.
Please rephrase your question, it is hard to comprehend.
FileBasicInformation current = share.getFileInformation(path, FileBasicInformation.class); current.getFileAttributes=34; What does 34 mean here?
current.getFileAttributes=38; What does 38 mean here?
I don't know what 34, 38 means here。
The values are described in the protocol spec here, https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ca28ec38-f155-4768-81d6-4bfeb8586fc9
34 looks like hidden+archive, and +4 is system.
The values are also defined as constants in FileAttributes https://www.javadoc.io/static/com.hierynomus/smbj/0.0.5/com/hierynomus/msfscc/FileAttributes.html#FILE_ATTRIBUTE_SYSTEM
You can check whether an attribute is set (or convert it to a set of attributes using):
boolean isHidden = EnumWithValue.EnumUtils.isSet(current.getFileAttributes(), FileAttributes.FILE_ATTRIBUTE_HIDDEN);
Set<FileAttributes> attrs = EnumWithValue.EnumUtils.toEnumSet(current.getFileAttributes(), FileAttributes.class);
The values are described in the protocol spec here, https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ca28ec38-f155-4768-81d6-4bfeb8586fc9
34 looks like hidden+archive, and +4 is system.
The values are also defined as constants in FileAttributes https://www.javadoc.io/static/com.hierynomus/smbj/0.0.5/com/hierynomus/msfscc/FileAttributes.html#FILE_ATTRIBUTE_SYSTEM
Your answer is helpful to me. Thank you for your answer.
You can check whether an attribute is set (or convert it to a set of attributes using):
boolean isHidden = EnumWithValue.EnumUtils.isSet(current.getFileAttributes(), FileAttributes.FILE_ATTRIBUTE_HIDDEN); Set<FileAttributes> attrs = EnumWithValue.EnumUtils.toEnumSet(current.getFileAttributes(), FileAttributes.class);
Your answer is helpful to me. Thank you for your answer.
I'll close the issue as the question has been answered.
FileBasicInformation current = share.getFileInformation(path, FileBasicInformation.class); current.getFileAttributes What do you mean () equals 34 and 38,or Where can I find FileAttributes worth defining?