61 static TInt gClusterCount; |
61 static TInt gClusterCount; |
62 static TInt gEndOfChain; // for FAT12/16/32 |
62 static TInt gEndOfChain; // for FAT12/16/32 |
63 |
63 |
64 const TInt KMaxFatEntries = 2048; |
64 const TInt KMaxFatEntries = 2048; |
65 const TInt KMaxFatSize = KMaxFatEntries * 4; |
65 const TInt KMaxFatSize = KMaxFatEntries * 4; |
66 const TInt KDirAttrReadOnly = 0x01; |
66 |
67 const TInt KDirAttrHidden = 0x02; |
67 const TUint KDirAttrReadOnly = 0x01; |
68 const TInt KDirAttrSystem = 0x04; |
68 const TUint KDirAttrHidden = 0x02; |
69 const TInt KDirAttrVolumeId = 0x08; |
69 const TUint KDirAttrSystem = 0x04; |
70 const TInt KDirAttrDirectory = 0x10; |
70 const TUint KDirAttrVolumeId = 0x08; |
71 const TInt KDirAttrArchive = 0x20; |
71 const TUint KDirAttrDirectory = 0x10; |
72 const TInt KDirAttrLongName = KDirAttrReadOnly | KDirAttrHidden | KDirAttrSystem | KDirAttrVolumeId; |
72 const TUint KDirAttrArchive = 0x20; |
73 const TInt KDirAttrLongMask = KDirAttrLongName | KDirAttrDirectory | KDirAttrArchive; |
73 const TUint KDirAttrLongName = KDirAttrReadOnly | KDirAttrHidden | KDirAttrSystem | KDirAttrVolumeId; |
74 const TInt KDirLastLongEntry = 0x40; |
74 const TUint KDirAttrLongMask = KDirAttrLongName | KDirAttrDirectory | KDirAttrArchive; |
|
75 const TUint KDirLastLongEntry = 0x40; |
75 |
76 |
76 void CreateFatEntry(const TDesC& aDir, TBool aVFatEntry, TDes *apFileName=NULL); |
77 void CreateFatEntry(const TDesC& aDir, TBool aVFatEntry, TDes *apFileName=NULL); |
77 |
78 |
78 #define Error(aMess,aErr) PutError(__FILE__, __LINE__, aMess,aErr) |
79 #define Error(aMess,aErr) PutError(__FILE__, __LINE__, aMess,aErr) |
79 static void PutError(const char* aFile, TInt aLine, const TDesC& aMessage,TInt anErr) |
80 static void PutError(const char* aFile, TInt aLine, const TDesC& aMessage,TInt anErr) |
1524 if (pE->StartCluster()!=aNewClust) |
1525 if (pE->StartCluster()!=aNewClust) |
1525 Error(_L("Bad directory start cluster"),KErrNone); |
1526 Error(_L("Bad directory start cluster"),KErrNone); |
1526 pE++; |
1527 pE++; |
1527 if (pE->Name()[0]!='.' || pE->Name()[1]!='.') |
1528 if (pE->Name()[0]!='.' || pE->Name()[1]!='.') |
1528 Error(_L("Second entry is not '..'"),KErrNone); |
1529 Error(_L("Second entry is not '..'"),KErrNone); |
1529 if (pE->StartCluster() != ((aParentClust==gRootCluster)?0:aParentClust)) |
1530 if (pE->StartCluster() != ((aParentClust==(TUint)gRootCluster)?0:aParentClust)) |
1530 Error(_L("Start cluster of .. is not parent directory"),KErrNone); |
1531 Error(_L("Start cluster of .. is not parent directory"),KErrNone); |
1531 } |
1532 } |
1532 |
1533 |
1533 |
1534 |
1534 |
1535 |