Skip to content

Commit a53db7a

Browse files
committed
OrcLib: FileAttribute: fix missing attributes
1 parent b475377 commit a53db7a

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

src/OrcLib/Filesystem/FileAttribute.cpp

+14-12
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,34 @@ constexpr std::string_view kFileAttributeUnpinned = "FILE_ATTRIBUTE_UNPINNED";
4343
constexpr std::string_view kFileAttributeRecallOnOpen = "FILE_ATTRIBUTE_RECALL_ON_OPEN";
4444
constexpr std::string_view kFileAttributeRecallOnDataAccess = "FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS";
4545
constexpr std::string_view kFileAttributeStrictlySequential = "FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL";
46+
constexpr std::string_view kFileAttributeCascadesRemote = "FILE_ATTRIBUTE_CASCADES_REMOTE";
4647

48+
// Letters are from 'attrib' then 'propsys.dll' or guessed
4749
constexpr std::array kFileAttributes = {
4850
std::tuple {FileAttribute::kFileAttributeReadOnly, kFileAttributeReadOnly, 'R'},
4951
std::tuple {FileAttribute::kFileAttributeHidden, kFileAttributeHidden, 'H'},
5052
std::tuple {FileAttribute::kFileAttributeSystem, kFileAttributeSystem, 'S'},
51-
std::tuple {FileAttribute::kFileAttributeDirectory, kFileAttributeDirectory, 'D'},
53+
std::tuple {FileAttribute::kFileAttributeDirectory, kFileAttributeDirectory, 'D'}, // propsys
5254
std::tuple {FileAttribute::kFileAttributeArchive, kFileAttributeArchive, 'A'},
53-
std::tuple {FileAttribute::kFileAttributeDevice, kFileAttributeDevice, 'd'},
54-
std::tuple {FileAttribute::kFileAttributeNormal, kFileAttributeNormal, 'N'},
55-
std::tuple {FileAttribute::kFileAttributeTemporary, kFileAttributeTemporary, 'T'},
56-
std::tuple {FileAttribute::kFileAttributeSparseFile, kFileAttributeSparseFile, 'P'},
57-
std::tuple {FileAttribute::kFileAttributeReparsePoint, kFileAttributeReparsePoint, 'L'},
58-
std::tuple {FileAttribute::kFileAttributeCompressed, kFileAttributeCompressed, 'C'},
55+
std::tuple {FileAttribute::kFileAttributeDevice, kFileAttributeDevice, 'd'}, // 'X' (propsys)
56+
std::tuple {FileAttribute::kFileAttributeNormal, kFileAttributeNormal, 'N'}, // propsys
57+
std::tuple {FileAttribute::kFileAttributeTemporary, kFileAttributeTemporary, 'T'}, // propsys
58+
std::tuple {FileAttribute::kFileAttributeSparseFile, kFileAttributeSparseFile, 'p'}, // 'P' (propsys)
59+
std::tuple {FileAttribute::kFileAttributeReparsePoint, kFileAttributeReparsePoint, 'L'}, // propsys
60+
std::tuple {FileAttribute::kFileAttributeCompressed, kFileAttributeCompressed, 'C'}, // propsys
5961
std::tuple {FileAttribute::kFileAttributeOffline, kFileAttributeOffline, 'O'},
6062
std::tuple {FileAttribute::kFileAttributeNotContentIndexed, kFileAttributeNotContentIndexed, 'I'},
61-
std::tuple {FileAttribute::kFileAttributeEncrypted, kFileAttributeEncrypted, 'E'},
63+
std::tuple {FileAttribute::kFileAttributeEncrypted, kFileAttributeEncrypted, 'E'}, // propsys
6264
std::tuple {FileAttribute::kFileAttributeIntegrityStream, kFileAttributeIntegrityStream, 's'},
6365
std::tuple {FileAttribute::kFileAttributeVirtual, kFileAttributeVirtual, 'V'},
6466
std::tuple {FileAttribute::kFileAttributeNoScrubData, kFileAttributeNoScrubData, 'B'},
6567
std::tuple {FileAttribute::kFileAttributeEA, kFileAttributeEA, 'e'},
6668
std::tuple {FileAttribute::kFileAttributePinned, kFileAttributePinned, 'p'},
6769
std::tuple {FileAttribute::kFileAttributeUnpinned, kFileAttributeUnpinned, 'u'},
68-
std::tuple {FileAttribute::kFileAttributeRecallOnOpen, kFileAttributeRecallOnOpen, 'o'},
69-
std::tuple {FileAttribute::kFileAttributeRecallOnDataAccess, kFileAttributeRecallOnDataAccess, 'a'},
70-
std::tuple {FileAttribute::kFileAttributeStrictlySequential, kFileAttributeStrictlySequential, 'l'}
71-
};
70+
// std::tuple {FileAttribute::kFileAttributeRecallOnOpen, kFileAttributeRecallOnOpen, 'o'},
71+
std::tuple {FileAttribute::kFileAttributeRecallOnDataAccess, kFileAttributeRecallOnDataAccess, 'M'}, // propsys
72+
std::tuple {FileAttribute::kFileAttributeStrictlySequential, kFileAttributeStrictlySequential, 'B'},
73+
std::tuple {FileAttribute::kFileAttributeCascadesRemote, kFileAttributeCascadesRemote, 'c'}};
7274

7375
bool HasInvalidFlag(uint32_t flags)
7476
{

src/OrcLib/Filesystem/FileAttribute.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ namespace Orc {
3131
#define ORC_FILE_ATTRIBUTE_EA 0x00040000
3232
#define ORC_FILE_ATTRIBUTE_PINNED 0x00080000
3333
#define ORC_FILE_ATTRIBUTE_UNPINNED 0x00100000
34-
#define ORC_FILE_ATTRIBUTE_RECALL_ON_OPEN 0x00040000
34+
//#define ORC_FILE_ATTRIBUTE_RECALL_ON_OPEN 0x00040000 // ReFS only ? Conflict with FILE_ATTRIBUTE_EA
3535
#define ORC_FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS 0x00400000
3636

3737
//#define ORC_FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL 0x00200000 // 10.0.16267.0
3838
#define ORC_FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL 0x20000000 // >= 10.0.17134.0
39+
#define ORC_FILE_ATTRIBUTE_CASCADES_REMOTE 0x40000000
3940

4041
enum class FileAttribute : uint32_t
4142
{
@@ -59,9 +60,10 @@ enum class FileAttribute : uint32_t
5960
kFileAttributeEA = ORC_FILE_ATTRIBUTE_EA,
6061
kFileAttributePinned = ORC_FILE_ATTRIBUTE_PINNED,
6162
kFileAttributeUnpinned = ORC_FILE_ATTRIBUTE_UNPINNED,
62-
kFileAttributeRecallOnOpen = ORC_FILE_ATTRIBUTE_RECALL_ON_OPEN,
63+
//kFileAttributeRecallOnOpen = ORC_FILE_ATTRIBUTE_RECALL_ON_OPEN,
6364
kFileAttributeRecallOnDataAccess = ORC_FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS,
64-
kFileAttributeStrictlySequential = ORC_FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL
65+
kFileAttributeStrictlySequential = ORC_FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL,
66+
kFileAttributeCascadesRemote = ORC_FILE_ATTRIBUTE_CASCADES_REMOTE
6567
};
6668

6769
ENABLE_BITMASK_OPERATORS(FileAttribute)

0 commit comments

Comments
 (0)