Moving entities from one volume to another

To move a file or directory subtree from one volume to another, you need to use TFileSystemCopier::Copy and TFileSystemEntity::DeleteSelf.

This example moves a directory and all directories beneath it from a directory on one volume to the root directory on another volume. The sourceDirectory parameter is a TDirectory instance, and destinationDirectory is a TVolume instance (representing the root directory on that volume). This example passes True to DeleteSelf to delete all children of the directory before deleting the directory itself.

      TFileSystemMover aCopier;
      aCopier.Copy(sourceDirectory, destinationDirectory);
      sourceDirectory.DeleteSelf(True);

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker