equal
deleted
inserted
replaced
372 void CLocalMountCB::DeleteL(const TDesC& aName) |
372 void CLocalMountCB::DeleteL(const TDesC& aName) |
373 { |
373 { |
374 |
374 |
375 if (IsRomDrive()) |
375 if (IsRomDrive()) |
376 User::Leave(KErrAccessDenied); |
376 User::Leave(KErrAccessDenied); |
377 TFileName n; |
377 |
|
378 //-- check entry attributes |
|
379 TEntry entry; |
|
380 EntryL(aName, entry); |
|
381 if (entry.IsDir() || entry.IsReadOnly()) |
|
382 User::Leave(KErrAccessDenied); |
|
383 |
|
384 TFileName n; |
378 MapFileNameL(n,Drive().DriveNumber(),aName); |
385 MapFileNameL(n,Drive().DriveNumber(),aName); |
379 BOOL b=Emulator::DeleteFile(StrPtrZL(n)); |
386 BOOL b=Emulator::DeleteFile(StrPtrZL(n)); |
380 |
387 |
381 if (!b) |
388 if (!b) |
382 User::Leave(Emulator::LastError()); |
389 User::Leave(Emulator::LastError()); |
945 WIN32_FIND_DATA d; |
952 WIN32_FIND_DATA d; |
946 HANDLE h=Emulator::FindFirstFile(StrPtrZL(n),&d); |
953 HANDLE h=Emulator::FindFirstFile(StrPtrZL(n),&d); |
947 if (h==INVALID_HANDLE_VALUE) |
954 if (h==INVALID_HANDLE_VALUE) |
948 User::Leave(Emulator::LastError()); |
955 User::Leave(Emulator::LastError()); |
949 FindClose(h); |
956 FindClose(h); |
950 if (d.cAlternateFileName[0]) // we have a dos name too |
957 if (d.cAlternateFileName[0]) // we have a dos name too |
951 aShortName=(TText*)(&d.cAlternateFileName[0]); |
958 aShortName=(TText*)(&d.cAlternateFileName[0]); |
952 else |
959 else |
953 aShortName=(TText*)(&d.cFileName[0]); |
960 aShortName=(TText*)(&d.cFileName[0]); |
954 } |
961 } |
955 |
962 |
956 //------------------------------------------------------------------------------------------------------------------- |
963 //------------------------------------------------------------------------------------------------------------------- |
1409 User::Leave(KErrNotSupported); |
1416 User::Leave(KErrNotSupported); |
1410 |
1417 |
1411 CheckPosL(aPos); |
1418 CheckPosL(aPos); |
1412 TInt pos=0; |
1419 TInt pos=0; |
1413 TInt len=aLength; |
1420 TInt len=aLength; |
1414 TBuf8<0x1000> buf; |
1421 TBuf8<65536> buf; |
1415 |
1422 |
1416 if (aMessage.Handle() == KLocalMessageHandle) |
1423 if (aMessage.Handle() == KLocalMessageHandle) |
1417 ((TPtr8* )aDes)->SetLength(0); |
1424 ((TPtr8* )aDes)->SetLength(0); |
1418 |
1425 |
1419 while (len) |
1426 while (len) |
1469 User::Leave(KErrNotSupported); |
1476 User::Leave(KErrNotSupported); |
1470 |
1477 |
1471 CheckPosL(aPos); |
1478 CheckPosL(aPos); |
1472 TInt pos=0; |
1479 TInt pos=0; |
1473 TInt len=aLength; |
1480 TInt len=aLength; |
1474 TBuf8<0x1000> buf; |
1481 TBuf8<65536> buf; |
1475 |
1482 |
1476 while (len) |
1483 while (len) |
1477 { |
1484 { |
1478 TInt s=Min(len,buf.MaxLength()); |
1485 TInt s=Min(len,buf.MaxLength()); |
1479 |
1486 |