On Mar 9, 2007, at 12:52 PM, Giovanni wrote:

> I have a project to move to the mac and need to move a directory  
> and the
> entire content of  the directory to another volume.
>
> On the PC its a cinch but on the mac(im new on macs) I was wondering
> what would be the most efficient and fastest way to do file comparison
> and the moving of files.

Dim shMover As New Shell

// If the from and to folder are on the same volume
shMover.Execute "mv " + sourcePath " + " " destPath
If shMover.Errorcode <> 0 Then
        MsgBox "Move failed!" + EndofLine + EndOfLine + shMover.Result
End If

// If they source and dest are on different volumes
shMover.Execute "cp -r " + sourcePath " + " " destPath
If shMover.Errorcode <> 0 Then
        MsgBox "Move failed!" + EndofLine + EndOfLine + shMover.Result
Else
        shMover.Execute "rm -rf " + sourcePath
        // might want to handle error here just in case...
End If

Note that moving a folder on Unix-based systems within the same  
volume moves the contents automatically.  Basically, all you're doing  
on the move is renaming the folder.  However, if you're moving across  
devices, you need to cp (copy) and then rm (delete) the source path.

HTH,

Tim
--
Tim Jones
[EMAIL PROTECTED]

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to