userlibandfileserver/fileserver/sfsrv/cl_cli.cpp
changeset 266 0008ccd16016
parent 247 d8d70de2bd36
equal deleted inserted replaced
259:57b9594f5772 266:0008ccd16016
   329 	}
   329 	}
   330 
   330 
   331 
   331 
   332 
   332 
   333 
   333 
       
   334 /**
       
   335     Load file system plugin (*.fsy module) and add a file system that it implements to the file server. 
       
   336     After loading the file system plugin  RFs::MountFileSystem() can be used to mount the file system on a drive.
       
   337 
       
   338     @param aFileName    The name of the file system plugin (*.FSY) to install. If only file name without extension is specified, 
       
   339                         ".fsy" extension is assumed by default.
       
   340                         A full path to the FSY module can be specified, otherwise standard rules of loading DLLs apply. 
       
   341 
       
   342     @return KErrNone    if successful, otherwise one of the other system-wide error codes.
       
   343 
       
   344 @capability DiskAdmin
       
   345 @see RFs::MountFileSystem        
       
   346 */
   334 EFSRV_EXPORT_C TInt RFs::AddFileSystem(const TDesC& aFileName) const
   347 EFSRV_EXPORT_C TInt RFs::AddFileSystem(const TDesC& aFileName) const
   335 /**
       
   336 Adds a file system to the file server.
       
   337 
       
   338 After calling this function, use MountFileSystem() to mount the file system
       
   339 on a drive.
       
   340 
       
   341 @param aFileName The name of the file system .FSY to install. Its full path can
       
   342 				 be specified.
       
   343 
       
   344 @return KErrNone, if successful, otherwise one of the other system-wide
       
   345         error codes.
       
   346 
       
   347 @capability DiskAdmin
       
   348         
       
   349 @see RFs::MountFileSystem        
       
   350 */
       
   351 	{
   348 	{
   352 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM, "sess %x", Handle());
   349 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM, "sess %x", Handle());
   353 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
   350 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDFILESYSTEM_EFILENAME, "FileName %S", aFileName.Ptr(), aFileName.Length()<<1);
   354 	RLoader loader;
   351 	RLoader loader;
   355 	TInt r = loader.Connect();
   352 	TInt r = loader.Connect();
   363 	}
   360 	}
   364 
   361 
   365 
   362 
   366 
   363 
   367 
   364 
       
   365 /**
       
   366     Removes the specified file system from the file server and unloads its plugin dll (*.fsy)
       
   367 
       
   368     @param aFileSystemName  The name of the file system to be removed. File system name that is bound to some drive can be retrieved by 
       
   369                             RFs::FileSystemName(). Note that this is _not_ the name of the plugin (*.fsy).
       
   370 
       
   371     @return KErrNone        if successful
       
   372             KErrNotFound    if aFileSystemName is not found
       
   373             otherwise one of the other system-wide error codes.
       
   374 
       
   375     @capability DiskAdmin
       
   376 
       
   377 */
   368 EFSRV_EXPORT_C TInt RFs::RemoveFileSystem(const TDesC& aFileSystemName) const
   378 EFSRV_EXPORT_C TInt RFs::RemoveFileSystem(const TDesC& aFileSystemName) const
   369 /**
       
   370 Removes the specified file system.
       
   371 
       
   372 @param aFileSystemName The fullname of the file system, as returned from
       
   373                        a call to FileSystemName(), to be removed.
       
   374 
       
   375 @return KErrNone, if successful;
       
   376         KErrNotFound, if aFileSystemName is not found;
       
   377         otrherwise one of the other system-wide error codes.
       
   378 
       
   379 @capability DiskAdmin
       
   380 
       
   381 */
       
   382 	{
   379 	{
   383 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM, "sess %x", Handle());
   380 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM, "sess %x", Handle());
   384 	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   381 	OstTraceData(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   385 	TInt r = SendReceive(EFsRemoveFileSystem,TIpcArgs(&aFileSystemName));
   382 	TInt r = SendReceive(EFsRemoveFileSystem,TIpcArgs(&aFileSystemName));
   386 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEMRETURN, "r %d", r);
   383 	OstTrace1(TRACE_BORDER, EFSRV_EFSREMOVEFILESYSTEMRETURN, "r %d", r);
   388 	}
   385 	}
   389 
   386 
   390 
   387 
   391 
   388 
   392 
   389 
       
   390 /**
       
   391     Mounts a file system on a drive.
       
   392     The file system must first have been added to the file server using AddFileSystem().
       
   393     The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;
       
   394 
       
   395     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
       
   396                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   397                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   398 
       
   399     @param aDrive           The drive number on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   400 
       
   401     @return KErrNone        if successful 
       
   402             KErrLocked      if the media is locked
       
   403             KErrCorrupt     most likely means that the data structures on the media are not recognized by the given file system. This 
       
   404                             usually happens when the medium is damaged, unformatted, formatted with a different file system or vital file system structures are 
       
   405                             corrupted.
       
   406 
       
   407             otherwise one of the other system-wide error codes.
       
   408 
       
   409     @capability DiskAdmin
       
   410 
       
   411     @see RFs::AddFileSystem
       
   412     @see RFs::FileSystemName
       
   413 */
   393 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const
   414 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const
   394 /**
       
   395 Mounts a file system on a drive.
       
   396 
       
   397 The file system must first have been added to the file server using AddFileSystem().
       
   398 The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;
       
   399 
       
   400 @param aFileSystemName The fullname of the file system, as returned from  a call to FileSystemName().
       
   401 @param aDrive          The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   402 
       
   403 @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
   404 
       
   405 @capability DiskAdmin
       
   406 
       
   407 @see RFs::AddFileSystem
       
   408 @see RFs::FileSystemName
       
   409 */
       
   410 	{
   415 	{
   411 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   416 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   412 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   417 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   413 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,EFalse));
   418 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,EFalse));
   414 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1RETURN, "r %d", r);
   419 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM1RETURN, "r %d", r);
   417 
   422 
   418 
   423 
   419 
   424 
   420 
   425 
   421 
   426 
   422 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,TInt aDrive, TBool aIsSync) const
   427 /**
   423 /**
   428     Mounts a file system on a drive.
   424 Mounts a file system on a specified drive.
       
   425 
       
   426 The file system must first have been added to the file server using AddFileSystem().
   429 The file system must first have been added to the file server using AddFileSystem().
   427 Depending on the aIsSync parameter, the drive can be mounted as synchronous or asynchronous.
   430 Depending on the aIsSync parameter, the drive can be mounted as synchronous or asynchronous.
   428 
   431 
   429 Asynchronous drive has its own processing thread, i.e operations on it don't block the file server and other drives;
   432 Asynchronous drive has its own processing thread, i.e operations on it don't block the file server and other drives;
   430 Synchronous drives' requests are being processed by the main file server thread and there is a possibility to block it along with
   433 Synchronous drives' requests are being processed by the main file server thread and there is a possibility to block it along with
   431 all operations on other drives. Mounting a drive as synch. makes a sense if the operations on such drive are very fast e.g. this is an
   434 all operations on other drives. Mounting a drive as synch. makes a sense if the operations on such drive are very fast e.g. this is an
   432 internal RAM or ROFS drive.
   435 internal RAM or ROFS drive.
   433 
   436 
   434 @param aFileSystemName The fullname of the file system, as returned from a call to FileSystemName().
   437     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
       
   438                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   439                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   440 
   435 @param aDrive          The drive number on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
   441 @param aDrive          The drive number on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
   436 
   442 
   437 @param aIsSync         if ETrue  the drive will be mounted as synchronous one;
   443 @param aIsSync         if ETrue  the drive will be mounted as synchronous one;
   438                        if EFalse the drive will be mounted as Asynchronous.
   444                        if EFalse the drive will be mounted as Asynchronous.
   439 
   445 
   440 @return KErrNone if successful, otherwise one of the other system-wide error codes.
   446 @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
   447 
   441 @capability DiskAdmin
   448 @capability DiskAdmin
   442 @see RFs::AddFileSystem
   449 @see RFs::AddFileSystem
   443 @see RFs::FileSystemName
   450 @see RFs::FileSystemName
   444 */
   451 */
       
   452 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,TInt aDrive, TBool aIsSync) const
   445 	{
   453 	{
   446 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
   454 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
   447 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   455 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   448 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,aIsSync));
   456 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,NULL,aIsSync));
   449 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2RETURN, "r %d", r);
   457 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM2RETURN, "r %d", r);
   451 	}
   459 	}
   452 
   460 
   453 
   461 
   454 
   462 
   455 
   463 
       
   464 /**
       
   465     Mounts a file system on a drive, along with the specified primary drive extension.
       
   466 
       
   467     The file system must first have been added to the file server using AddFileSystem().
       
   468     The extension must first have been added to the file server using AddExtension().
       
   469     The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;
       
   470 
       
   471     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
       
   472                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   473                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   474 
       
   475     @param aExtensionName   The name of the primary drive extension. It has the same conventions as the aFileSystemName.
       
   476 
       
   477     @param aDrive           The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   478 
       
   479     @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
   480 
       
   481     @capability DiskAdmin
       
   482 
       
   483     @see RFs::AddFileSystem
       
   484     @see RFs::FileSystemName
       
   485 */
   456 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive)
   486 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive)
   457 /**
       
   458 Mounts a file system on a drive, and the specified extension.
       
   459 
       
   460 The file system must first have been added to the file server using AddFileSystem().
       
   461 The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;
       
   462 
       
   463 @param aFileSystemName The fullname of the file system, as returned from a call to FileSystemName().
       
   464 @param aExtensionName  The filename of the extension.
       
   465 @param aDrive          The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   466 
       
   467 @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
   468 
       
   469 @capability DiskAdmin
       
   470 
       
   471 @see RFs::AddFileSystem
       
   472 @see RFs::FileSystemName
       
   473 */
       
   474 	{
   487 	{
   475 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   488 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   476 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   489 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   477 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   490 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM3_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   478 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,EFalse));
   491 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,EFalse));
   481 	}
   494 	}
   482 
   495 
   483 
   496 
   484 
   497 
   485 
   498 
       
   499 /**
       
   500     Mounts a file system on a drive, along with the specified primary drive extension.
       
   501 
       
   502     The file system must first have been added to the file server using AddFileSystem().
       
   503     The extension must first have been added to the file server using AddExtension().
       
   504     Depending on the aIsSync parameter, the drive can be mounted as synchronous or asynchronous.
       
   505 
       
   506     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
       
   507                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   508                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   509 
       
   510     @param aExtensionName   The name of the primary drive extension. It has the same conventions as the aFileSystemName.
       
   511 
       
   512     @param aDrive           The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   513 
       
   514     @param aIsSync         if ETrue  the drive will be mounted as synchronous one;
       
   515                            if EFalse the drive will be mounted as Asynchronous.
       
   516 
       
   517 
       
   518     @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
   519 
       
   520     @capability DiskAdmin
       
   521 
       
   522     @see RFs::AddFileSystem
       
   523     @see RFs::FileSystemName
       
   524 
       
   525 */
   486 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive, TBool aIsSync)
   526 EFSRV_EXPORT_C TInt RFs::MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive, TBool aIsSync)
   487 /**
       
   488 Mounts a file system on a drive, and the specified extension.
       
   489 
       
   490 The file system must first have been added to the file server using AddFileSystem().
       
   491 
       
   492 Depending on the aIsSync parameter, the drive can be mounted as synchronous or asynchronous.
       
   493 
       
   494 Asynchronous drive has its own processing thread, i.e operations on it don't block the file server and other drives;
       
   495 Synchronous drives' requests are being processed by the main file server thread and there is a possibility to block it along with
       
   496 all operations on other drives. Mounting a drive as synch. makes  sense if the operations on such drive are very fast e.g. this is an
       
   497 internal RAM or ROFS drive.
       
   498 
       
   499 @param aFileSystemName The fullname of the file system, as returned from a call to FileSystemName().
       
   500 @param aExtensionName  The filename of the extension.
       
   501 @param aDrive          The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   502 
       
   503 @param aIsSync         if ETrue  the drive will be mounted as synchronous one;
       
   504                        if EFalse the drive will be mounted as Asynchronous.
       
   505 
       
   506 @return KErrNone if successful, otherwise one of the other system-wide error codes.
       
   507 
       
   508 @capability DiskAdmin
       
   509 
       
   510 @see RFs::AddFileSystem
       
   511 @see RFs::FileSystemName
       
   512 */
       
   513 	{
   527 	{
   514 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
   528 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4, "sess %x aDrive %d aIsSync %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsSync);
   515 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   529 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   516 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   530 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEM4_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   517 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,aIsSync));
   531 	TInt r = SendReceive(EFsMountFileSystem,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,aIsSync));
   519 	return r;
   533 	return r;
   520 	}
   534 	}
   521 
   535 
   522 
   536 
   523 
   537 
   524 
   538 /**
       
   539     Mounts a file system on a drive, and performs a scan on that drive by calling RFs::ScanDrive.
       
   540     The file system must first have been added to the file server using AddFileSystem().
       
   541     Note that the scan is done only if the mount is successful.
       
   542 
       
   543     The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;
       
   544 
       
   545     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
       
   546                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   547                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   548     
       
   549     @param aDrive           The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   550     
       
   551     @param aIsMountSuccess  On return, set to: ETrue, if the  if the mount is successful, set to EFalse otherwise.
       
   552 
       
   553     @return KErrNone if successful, otherwise one of the other system-wide error codes, reflecting the failure of the mount operation. 
       
   554 
       
   555     @capability DiskAdmin
       
   556 
       
   557     @see RFs::ScanDrive
       
   558     @see RFs::TDriveNumber
       
   559     @see RFs::AddFileSystem
       
   560     @see RFs::FileSystemName
       
   561 */
   525 EFSRV_EXPORT_C TInt RFs::MountFileSystemAndScan(const TDesC& aFileSystemName,TInt aDrive,TBool& aIsMountSuccess) const
   562 EFSRV_EXPORT_C TInt RFs::MountFileSystemAndScan(const TDesC& aFileSystemName,TInt aDrive,TBool& aIsMountSuccess) const
   526 /**
       
   527 Mounts a file system on a drive, and performs a scan on that drive.
       
   528 The file system must first have been added to the file server using AddFileSystem().
       
   529 
       
   530 Note that the scan is done only if the mount is successful.
       
   531 
       
   532 The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;
       
   533 
       
   534 @param aFileSystemName The fullname of the file system, as returned from a call to FileSystemName().
       
   535 @param aDrive          The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   536 @param aIsMountSuccess On return, set to: ETrue, if the  if the mount is successful, set to EFalse otherwise.
       
   537 
       
   538 @return KErrNone if successful, otherwise one of the other system-wide error codes, reflecting the failure of the mount operation. 
       
   539 
       
   540 @capability DiskAdmin
       
   541 
       
   542 @see RFs::TDriveNumber
       
   543 @see RFs::AddFileSystem
       
   544 @see RFs::FileSystemName
       
   545 */
       
   546 	{
   563 	{
   547 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   564 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   548 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   565 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   549 	aIsMountSuccess=EFalse;
   566 	aIsMountSuccess=EFalse;
   550 	TPckg<TInt> pckg(aIsMountSuccess);
   567 	TPckg<TInt> pckg(aIsMountSuccess);
   551 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,NULL,&pckg));
   568 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,NULL,&pckg));
   552 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
   569 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN1RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
   553 	return r;
   570 	return r;
   554 	}
   571 	}
   555 
   572 
       
   573 /**
       
   574 
       
   575     Mounts a file system on a drive, along with the specified primary drive extension and performs a scan on that drive by calling RFs::ScanDrive.
       
   576 
       
   577     The file system must first have been added to the file server using AddFileSystem().
       
   578     The extension must first have been added to the file server using AddExtension().
       
   579     Note that the scan is done only if the mount is successful.
       
   580     The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives.
       
   581 
       
   582     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
       
   583                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   584                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   585 
       
   586     @param aExtensionName   The name of the primary drive extension. It has the same conventions as the aFileSystemName.
       
   587     
       
   588     @param aDrive           The drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
       
   589     
       
   590     @param aIsMountSuccess  On return, set to: ETrue, if the  if the mount is successful, set to EFalse otherwise.
       
   591 
       
   592     @return KErrNone if successful, otherwise one of the other system-wide error codes, reflecting the failure of the mount operation. 
       
   593 
       
   594 */
   556 EFSRV_EXPORT_C TInt RFs::MountFileSystemAndScan(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive,TBool& aIsMountSuccess) const
   595 EFSRV_EXPORT_C TInt RFs::MountFileSystemAndScan(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive,TBool& aIsMountSuccess) const
   557 /**
       
   558 Mounts a file system on a drive, and the specified extension and performs a scan on that drive.
       
   559 
       
   560 The file system must first have been added to the file server,
       
   561 using AddFileSystem().
       
   562 
       
   563 Note that the scan is done only if the mount is successful.
       
   564 
       
   565 The operation is asynchronous, i.e other concurrent file server operations can continue.
       
   566 
       
   567 @param aFileSystemName The fullname of the file system, as returned from
       
   568                        a call to FileSystemName().
       
   569 @param aExtensionName  The filename of the extension.
       
   570 @param aDrive          The drive on which the file system is to be mounted;
       
   571                        this can be one of the values defined by TDriveNumber.
       
   572 @param aIsMountSuccess On return, set to: ETrue, if the  if the mount
       
   573                        is successful, set to EFalse otherwise.
       
   574 
       
   575 @return KErrNone if successful, otherwise one of the other system-wide
       
   576         error codes, reflecting the failure of the mount operation. 
       
   577 
       
   578 @capability DiskAdmin
       
   579 
       
   580 @see RFs::TDriveNumber
       
   581 @see RFs::AddFileSystem
       
   582 @see RFs::FileSystemName
       
   583 */
       
   584 	{
   596 	{
   585 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2, "sess %x aDrive %d aIsMountSuccess %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsMountSuccess);
   597 	OstTraceExt3(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2, "sess %x aDrive %d aIsMountSuccess %d", (TUint) Handle(), (TUint) aDrive, (TUint) aIsMountSuccess);
   586 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   598 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   587 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   599 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   588 	aIsMountSuccess=EFalse;
   600 	aIsMountSuccess=EFalse;
   590 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,&pckg));
   602 	TInt r = SendReceive(EFsMountFileSystemScan,TIpcArgs(&aFileSystemName,aDrive,&aExtensionName,&pckg));
   591 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
   603 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTFILESYSTEMANDSCAN2RETURN, "r %d aIsMountSuccess %d", (TUint) r, (TUint) aIsMountSuccess);
   592 	return r;
   604 	return r;
   593 	}
   605 	}
   594 
   606 
   595 EFSRV_EXPORT_C TInt RFs::DismountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const
   607 
   596 /**
   608 /**
   597 Dismounts the file system from the specified drive.
   609 Dismounts the file system from the specified drive.
   598 
   610     Note that is not possible to dismount a file system if its has objects opened, like files, directories, formats etc.
   599 @param aFileSystemName The fullname of the file system, as returned from
   611 
   600                        a call to FileSystemName().
   612     @param aFileSystemName  The name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy).
   601 @param aDrive          The drive from which the file system is to be dismounted.
   613                             The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent.
       
   614                             The maximum lentgth of the file name is KMaxFSNameLength.
       
   615                             The file system name on the drive can be retrieved by a call to RFs::FileSystemName().
       
   616                             
       
   617     @param aDrive           The drive number from which the file system is to be dismounted.
   602 
   618 
   603 @return KErrNone, if successful;
   619 @return KErrNone, if successful;
   604         KErrNotFound, if aFileSystemName is not found;
   620         KErrNotFound, if aFileSystemName is not found;
   605         KErrNotReady, if the drive does not have a file	system mounted on it;
   621         KErrNotReady, if the drive does not have a file	system mounted on it;
   606         KErrInUse, if the drive has a resource open	on it;
   622         KErrInUse, if the drive has a resource open	on it;
   607         KErrAccessDenied, if there is an attempt to dismount a ROM file system,
   623             KErrAccessDenied, if there is an attempt to dismount a ROM file system, a substituted drive, or the drive which is the default drive;
   608         a substituted drive, or the drive which is the default drive;
       
   609  		KErrArgument, if the specified drive value is outsdide of the valid range.
   624  		KErrArgument, if the specified drive value is outsdide of the valid range.
   610  		KErrPermissionDenied, if the client does not have the necessary capabilities 
   625  		    KErrPermissionDenied, if the client does not have the necessary capabilities to dismount the file system. 		
   611  		to dismount the file system. 		
       
   612 
   626 
   613 @capability DiskAdmin
   627 @capability DiskAdmin
   614  		
   628  		
   615 @see RFs::FileSystemName 		
   629 @see RFs::FileSystemName 		
   616 */
   630 */
       
   631 EFSRV_EXPORT_C TInt RFs::DismountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const
   617 	{
   632 	{
   618 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   633 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   619 	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   634 	OstTraceData(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEM_EFILESYSTEMNAME, "FileSystemName %S", aFileSystemName.Ptr(), aFileSystemName.Length()<<1);
   620 	TInt r = SendReceive(EFsDismountFileSystem,TIpcArgs(&aFileSystemName,aDrive));
   635 	TInt r = SendReceive(EFsDismountFileSystem,TIpcArgs(&aFileSystemName,aDrive));
   621 	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEMRETURN, "r %d", r);
   636 	OstTrace1(TRACE_BORDER, EFSRV_EFSDISMOUNTFILESYSTEMRETURN, "r %d", r);
   632     @param aName  On successful return, contains the name of the file system.
   647     @param aName  On successful return, contains the name of the file system.
   633     @param aDrive The drive for which the file system name is required.
   648     @param aDrive The drive for which the file system name is required.
   634 
   649 
   635     Note that the file system name, returned in the aName descriptor shall be threated as case-insensitive string. I.e. 
   650     Note that the file system name, returned in the aName descriptor shall be threated as case-insensitive string. I.e. 
   636     "fileSystem" and "FILESYSTEM" mean absolutely the same. Therefore, case-insensitive string methods (like TDesC::FindF(), TDesC::CompareF())
   651     "fileSystem" and "FILESYSTEM" mean absolutely the same. Therefore, case-insensitive string methods (like TDesC::FindF(), TDesC::CompareF())
   637     shall be used to deal with the names.
   652     shall be used to deal with the file system names.
   638 
   653 
   639     @return KErrNone, if successful;
   654     @return KErrNone, if successful;
   640             KErrNotFound if aFileSystemName is not found, or the drive does not have a file	system mounted on it;
   655             KErrNotFound if aFileSystemName is not found, or the drive does not have a file	system mounted on it;
   641             KErrArgument, if the drive value is outside the valid range, i.e. zero to KMaxDrives-1 inclusive.
   656             KErrArgument, if the drive value is outside the valid range, i.e. zero to KMaxDrives-1 inclusive.
   642 
   657 
   692     }
   707     }
   693 
   708 
   694 
   709 
   695 
   710 
   696 
   711 
   697 
   712 /**
       
   713     Load file system extension module and add it to the file server. 
       
   714 
       
   715     @param aFileName    The name of the extension plugin (usually *.FXT) to install. 
       
   716                         A full path to the module can be specified, otherwise standard rules of loading DLLs apply. 
       
   717 
       
   718     @see RFs::AddFileSystem   
       
   719 
       
   720 @param aFileName The file name of the extension
       
   721 @return KErrNone, if successful; otherwise one of the other system wide error codes.
       
   722 */
   698 EFSRV_EXPORT_C TInt RFs::AddExtension(const TDesC& aFileName)
   723 EFSRV_EXPORT_C TInt RFs::AddExtension(const TDesC& aFileName)
   699 /**
       
   700 Loads the specified extension.
       
   701 
       
   702 @param aFileName The file name of the extension
       
   703 
       
   704 @return KErrNone, if successful; otherwise one of the other system wide error codes.
       
   705 */
       
   706 	{
   724 	{
   707 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDEXTENSION, "sess %x", Handle());
   725 	OstTrace1(TRACE_BORDER, EFSRV_EFSADDEXTENSION, "sess %x", Handle());
   708 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aFileName.Ptr(), aFileName.Length()<<1);
   726 	OstTraceData(TRACE_BORDER, EFSRV_EFSADDEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aFileName.Ptr(), aFileName.Length()<<1);
   709 	RLoader loader;
   727 	RLoader loader;
   710 	TInt r = loader.Connect();
   728 	TInt r = loader.Connect();
   717 	return r;
   735 	return r;
   718 	}
   736 	}
   719 
   737 
   720 
   738 
   721 
   739 
   722 
       
   723 EFSRV_EXPORT_C TInt RFs::MountExtension(const TDesC& aExtensionName,TInt aDrive)
       
   724 /**
   740 /**
   725 Mounts the the specified extension.
   741 Mounts the the specified extension.
   726 
   742 
   727 The extension must first have been loaded using AddExtension().
   743 The extension must first have been loaded using AddExtension().
   728 
   744 
   729 @param aExtensionName  The fullname of the extension, as returned from
   745     @param aExtensionName   The fullname of the extension, as returned from a call to ExtensionName().
   730                        a call to ExtensionName().
   746                             The extension names have the same conventions as file system names i.e. case-insensitive and no longer than KMaxFSNameLength.
       
   747 
   731 @param aDrive          The drive on which the extension is to be mounted;
   748 @param aDrive          The drive on which the extension is to be mounted;
   732 
   749 
   733 @return KErrNone if successful;
   750 @return KErrNone if successful;
   734         KErrNotFound, if the extension cannot be found;
   751         KErrNotFound, if the extension cannot be found;
   735         otherwise one of the other system-wide error codes.
   752         otherwise one of the other system-wide error codes.
   736 
   753 
   737 @see RFs::ExtensionName
   754 @see RFs::ExtensionName
   738 */
   755 */
       
   756 EFSRV_EXPORT_C TInt RFs::MountExtension(const TDesC& aExtensionName,TInt aDrive)
   739 	{
   757 	{
   740 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   758 	OstTraceExt2(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION, "sess %x aDrive %d", (TUint) Handle(), (TUint) aDrive);
   741 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   759 	OstTraceData(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSION_EEXTENSIONNAME, "ExtensionName %S", aExtensionName.Ptr(), aExtensionName.Length()<<1);
   742 	TInt r = SendReceive(EFsMountExtension,TIpcArgs(&aExtensionName,aDrive));
   760 	TInt r = SendReceive(EFsMountExtension,TIpcArgs(&aExtensionName,aDrive));
   743 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSIONRETURN, "r %d", r);
   761 	OstTrace1(TRACE_BORDER, EFSRV_EFSMOUNTEXTENSIONRETURN, "r %d", r);