1167 void TDrive::DoEntryL(const TDesC& aName, TEntry& anEntry) |
1167 void TDrive::DoEntryL(const TDesC& aName, TEntry& anEntry) |
1168 // |
1168 // |
1169 // Get entry details |
1169 // Get entry details |
1170 // |
1170 // |
1171 { |
1171 { |
1172 FlushCachedFileInfoL(); |
|
1173 OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYL, "drive %d", DriveNumber()); |
1172 OstTrace1(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYL, "drive %d", DriveNumber()); |
1174 OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYL_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1); |
1173 OstTraceData(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYL_EFILEPATH, "FilePath %S", aName.Ptr(), aName.Length()<<1); |
1175 CurrentMount().EntryL(aName,anEntry); |
1174 CurrentMount().EntryL(aName,anEntry); |
|
1175 |
|
1176 // If the file is already open then read the file attributes directly from the file |
|
1177 TFileName foldedName; |
|
1178 TUint32 nameHash=0; |
|
1179 foldedName.CopyF(aName); |
|
1180 nameHash=CalcNameHash(foldedName); |
|
1181 |
|
1182 __CHECK_DRIVETHREAD(iDriveNumber); |
|
1183 TDblQueIter<CFileCB> q(CurrentMount().iMountQ); |
|
1184 CMountCB* currentMount = &CurrentMount(); |
|
1185 CFileCB* file; |
|
1186 while ((file=q++)!=NULL) |
|
1187 { |
|
1188 if ((&file->Drive()==this) && |
|
1189 &file->Mount() == currentMount && |
|
1190 nameHash == file->NameHash() && |
|
1191 file->FileNameF().Match(foldedName)==KErrNone) |
|
1192 { |
|
1193 anEntry.iAtt = file->Att() & ~KEntryAttModified; |
|
1194 anEntry.SetFileSize(file->CachedSize64()); |
|
1195 anEntry.iModified = file->Modified(); |
|
1196 break; |
|
1197 } |
|
1198 } |
|
1199 |
|
1200 |
1176 OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYLRET, "att %x modified %x:%x size %x:%x", (TUint) anEntry.iAtt, (TUint) I64HIGH(anEntry.iModified.Int64()), (TUint) I64LOW(anEntry.iModified.Int64()), (TUint) I64HIGH(anEntry.FileSize()), (TUint) anEntry.FileSize()); |
1201 OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECMOUNTCBENTRYLRET, "att %x modified %x:%x size %x:%x", (TUint) anEntry.iAtt, (TUint) I64HIGH(anEntry.iModified.Int64()), (TUint) I64LOW(anEntry.iModified.Int64()), (TUint) I64HIGH(anEntry.FileSize()), (TUint) anEntry.FileSize()); |
1177 } |
1202 } |
1178 |
1203 |
1179 TInt TDrive::CheckAttributes(const TDesC& aName,TUint& aSetAttMask,TUint& aClearAttMask) |
1204 TInt TDrive::CheckAttributes(TUint& aSetAttMask,TUint& aClearAttMask) |
1180 // |
1205 // |
1181 // Validate the changes against the current entry attributes |
1206 // Validate the changes against the current entry attributes |
1182 // |
1207 // |
1183 { |
1208 { |
1184 |
1209 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); |
1210 return(KErrNone); |
1191 } |
1211 } |
1192 |
1212 |
1193 TInt TDrive::SetEntry(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask) |
1213 TInt TDrive::SetEntry(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask) |
1194 // |
1214 // |