userlibandfileserver/fileserver/etshell/ts_com.cpp
changeset 247 d8d70de2bd36
parent 201 43365a9b78a3
child 254 1560c419b176
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
    82 
    82 
    83 
    83 
    84 LOCAL_C TInt pswd_DrvNbr(TDes &aPath, TInt &aDN);
    84 LOCAL_C TInt pswd_DrvNbr(TDes &aPath, TInt &aDN);
    85 LOCAL_C TInt pswd_Password(TDes &aPath, TInt aPWNbr, TMediaPassword &aPW);
    85 LOCAL_C TInt pswd_Password(TDes &aPath, TInt aPWNbr, TMediaPassword &aPW);
    86 
    86 
    87 _LIT(KLitNewLine,"\n");
       
    88 void CShell::NewLine()
    87 void CShell::NewLine()
    89 	{
    88 	{
    90 	TheConsole->Printf(KLitNewLine());
    89 	Printf(KNl);
    91 	}
    90 	}
    92 
    91 
    93 //
    92 //
    94 // Skip the hexadecimal prefix if present and return EHex.  Return
    93 // Skip the hexadecimal prefix if present and return EHex.  Return
    95 // EDecimal otherwise.
    94 // EDecimal otherwise.
   369 
   368 
   370 	    //-- this is, actually, FAT FS specific error codes. Other file systems can report different values.
   369 	    //-- this is, actually, FAT FS specific error codes. Other file systems can report different values.
   371 	    switch(nRes)
   370 	    switch(nRes)
   372 		    {
   371 		    {
   373 	    case 0:
   372 	    case 0:
   374 		    CShell::TheConsole->Printf(_L("Complete - no errors\n"));
   373 		    CShell::TheConsole->Printf(_L("Completed - no errors found\n"));
   375 		    break;
   374 		    break;
   376 	    case 1:
   375 	    case 1:
   377 		    CShell::TheConsole->Printf(_L("Error - File cluster chain contains a bad value (<2 or >maxCluster)\n"));
   376 		    CShell::TheConsole->Printf(_L("Error - File cluster chain contains a bad value (<2 or >maxCluster)\n"));
   378 		    break;
   377 		    break;
   379 	    case 2:
   378 	    case 2:
  1193                 TPckgBuf<TBool> boolPckg;
  1192                 TPckgBuf<TBool> boolPckg;
  1194                 nRes = aFs.QueryVolumeInfoExt(aDrvNum, EIsDriveFinalised, boolPckg);
  1193                 nRes = aFs.QueryVolumeInfoExt(aDrvNum, EIsDriveFinalised, boolPckg);
  1195                 if(nRes == KErrNone)
  1194                 if(nRes == KErrNone)
  1196                 {
  1195                 {
  1197                     if(boolPckg() >0)
  1196                     if(boolPckg() >0)
  1198                         Buf.Copy(_L("Volume: Finalised"));
  1197                         Buf.Copy(_L("Vol:Finalised "));
  1199                     else
  1198                     else
  1200                         Buf.Copy(_L("Volume: Not finalised"));
  1199                         Buf.Copy(_L("Vol:Not finalised "));
  1201                 }
  1200                 }
  1202 
  1201 
  1203                 //-- print out cluster size that FS reported
  1202                 //-- print out cluster size that FS reported
  1204                 TVolumeIOParamInfo volIoInfo;
  1203                 TVolumeIOParamInfo volIoInfo;
  1205                 nRes = aFs.VolumeIOParam(aDrvNum, volIoInfo);
  1204                 nRes = aFs.VolumeIOParam(aDrvNum, volIoInfo);
  1435         
  1434         
  1436     if(!aForceDismount)    
  1435     if(!aForceDismount)    
  1437     {//-- gaceful attempt to dismount the FS
  1436     {//-- gaceful attempt to dismount the FS
  1438     nRes = aFs.DismountFileSystem(fsName, aDrvNum);
  1437     nRes = aFs.DismountFileSystem(fsName, aDrvNum);
  1439     if(nRes != KErrNone)
  1438     if(nRes != KErrNone)
  1440     {
  1439         {
  1441         CShell::TheConsole->Printf(_L("Can't dismount FS!\n"));
  1440         CShell::TheConsole->Printf(_L("Can't dismount FS!\n"));
  1442         return nRes;
  1441         return nRes;
  1443     }
  1442         }
  1444     else
  1443     else
  1445     {
  1444         {
  1446     CShell::TheConsole->Printf(_L("'%S' filesystem dismounted from drive %c:\n"), &fsName, 'A'+aDrvNum);
  1445         CShell::TheConsole->Printf(_L("'%S' filesystem dismounted from drive %c:\n"), &fsName, 'A'+aDrvNum);
  1447     return KErrNone;
  1446         return KErrNone;
  1448     }
  1447         }
  1449 }
  1448     }
  1450     else
  1449     else
  1451     {//-- dismount by force
  1450     {//-- dismount by force
  1452         TRequestStatus rqStat;
  1451         TRequestStatus rqStat;
  1453         aFs.NotifyDismount(aDrvNum, rqStat, EFsDismountForceDismount);  
  1452         aFs.NotifyDismount(aDrvNum, rqStat, EFsDismountForceDismount);  
  1454         User::WaitForRequest(rqStat);
  1453         User::WaitForRequest(rqStat);