1163 void TDrive::DoEntryL(const TDesC& aName, TEntry& anEntry) |
1163 void TDrive::DoEntryL(const TDesC& aName, TEntry& anEntry) |
1164 // |
1164 // |
1165 // Get entry details |
1165 // Get entry details |
1166 // |
1166 // |
1167 { |
1167 { |
1168 FlushCachedFileInfoL(); |
|
1169 |
|
1170 TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBEntryL, EF32TraceUidFileSys, DriveNumber(), aName); |
1168 TRACEMULT2(UTF::EBorder, UTraceModuleFileSys::ECMountCBEntryL, EF32TraceUidFileSys, DriveNumber(), aName); |
1171 CurrentMount().EntryL(aName,anEntry); |
1169 CurrentMount().EntryL(aName,anEntry); |
|
1170 |
|
1171 // If the file is already open then read the file attributes directly from the file |
|
1172 TFileName foldedName; |
|
1173 TUint32 nameHash=0; |
|
1174 foldedName.CopyF(aName); |
|
1175 nameHash=CalcNameHash(foldedName); |
|
1176 |
|
1177 __CHECK_DRIVETHREAD(iDriveNumber); |
|
1178 TDblQueIter<CFileCB> q(CurrentMount().iMountQ); |
|
1179 CMountCB* currentMount = &CurrentMount(); |
|
1180 CFileCB* file; |
|
1181 while ((file=q++)!=NULL) |
|
1182 { |
|
1183 if ((&file->Drive()==this) && |
|
1184 &file->Mount() == currentMount && |
|
1185 nameHash == file->NameHash() && |
|
1186 file->FileNameF().Match(foldedName)==KErrNone) |
|
1187 { |
|
1188 anEntry.iAtt = file->Att() & ~KEntryAttModified; |
|
1189 anEntry.SetFileSize(file->CachedSize64()); |
|
1190 anEntry.iModified = file->Modified(); |
|
1191 break; |
|
1192 } |
|
1193 } |
|
1194 |
|
1195 |
1172 TRACE5(UTF::EBorder, UTraceModuleFileSys::ECMountCBEntryLRet, EF32TraceUidFileSys, |
1196 TRACE5(UTF::EBorder, UTraceModuleFileSys::ECMountCBEntryLRet, EF32TraceUidFileSys, |
1173 KErrNone, anEntry.iAtt, |
1197 KErrNone, anEntry.iAtt, |
1174 I64LOW(anEntry.iModified.Int64()), I64HIGH(anEntry.iModified.Int64()), |
1198 I64LOW(anEntry.iModified.Int64()), I64HIGH(anEntry.iModified.Int64()), |
1175 anEntry.iSize); |
1199 anEntry.iSize); |
1176 |
1200 |
1177 } |
1201 } |
1178 |
1202 |
1179 TInt TDrive::CheckAttributes(const TDesC& aName,TUint& aSetAttMask,TUint& aClearAttMask) |
1203 TInt TDrive::CheckAttributes(TUint& aSetAttMask,TUint& aClearAttMask) |
1180 // |
1204 // |
1181 // Validate the changes against the current entry attributes |
1205 // Validate the changes against the current entry attributes |
1182 // |
1206 // |
1183 { |
1207 { |
1184 |
1208 ValidateAtts(aSetAttMask,aClearAttMask); |
1185 TEntry entry; |
|
1186 TRAPD(r,DoEntryL(aName,entry)); |
|
1187 if (r!=KErrNone) |
|
1188 return(r); |
|
1189 ValidateAtts(entry.iAtt,aSetAttMask,aClearAttMask); |
|
1190 return(KErrNone); |
1209 return(KErrNone); |
1191 } |
1210 } |
1192 |
1211 |
1193 TInt TDrive::SetEntry(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask) |
1212 TInt TDrive::SetEntry(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask) |
1194 // |
1213 // |