Link to home
Start Free TrialLog in
Avatar of DanRollins
DanRollinsFlag for United States of America

asked on

Moving files accross the network

On a network with two Windows 2000 boxes:

1) If I an using windows Explorer to view a shared directory on the remote computer, and I drag a file from one directory on the remote box to another on the same remote box, does Windows send the entire contents of the file to my local computer and then back to the remote computer?

2) Do such file "move" operations work the same when accessing shares via command-line (i.e., in a batch file) or using other Windows API functions?

3) Is there a difference in the way this works if the share has been mapped to a drive ID?

4) If there is a process that "polls" for new files in a shared directory (using FindFirstFile() API), could that polling be an issue?  Could periodic use of the  FindFirstFile() API cause a logjam of some network activity queue?

=-=-=-=-=-=-=-=
I have a client who is experiencing intermittent delays -- sometimes several minutes in duration -- on a process that normally takes a fraction of a second.  The only thing unusual I can see about his setup is that he is using an external box to host the shared directory.

I appreciate your direct answer based upon your experience,  but please also provide a link to an article that discusses these issues.  

Thanks!
Avatar of oBdA
oBdA

1) Yes.
2) Yes.
3) No.
4) It might, but that might be more of a question for the programming section; it probably strongly depends on the polling interval ...

To elaborate a bit on parts 1-3:
On the remote machine, the Server service allows you to connect to the share.
On the local machine, the Workstation service (or Redirector) allows to connect to the share and makes it look like a local resource.
So if you copy a file stored on the remote machine using a local machine through a share, the file's complete content will take all the way through the network. Your workstation service passes the "read file" request to the Server service on the remote machine, the remote machine then reads the file from the hard drive and sends it back to your local machine. Your local machine will then send the "write file" request to the remote machine, which will put it back onto the hard disk.
There's no way for the remote machine to know that you're copying this file, and to "intercept" or "take ownership" of the copy and do it by itself. All the remote machine knows is that there's a read request for one file, and a write request for another file. What happens inbetween is for the local machine to decide.
Nope, I'm afraid I don't have any specific sources backing that up.
To copy large files in this case (assuming the remote machine is a server), it's best to enable terminal services in administration mode and copy the file(s) in question using an RDP session.
Avatar of DanRollins

ASKER

Copying a file is a separate issue:  
The data does need to be transferred from one place to another.  It seems to me that a smart OS would see that it is going from one place on one box to another on the same box and avoid all of the network traffic, but it is understandable if it does not make that distinction.

However, a file MOVE operation is a different animal:  
There is no need for either computer to physically read the file data -- it all boils down to making minor changes to a couple of directories.  Again, a smart OS should be able to detect that situation and bypass the data read/write.
Smart OS = Oxymoron  eh,?  :)
If it's a real move (that is, the file to be moved stays on the same partition), then the remote server is smart enough to just change the file table (at least on NT4, W2k, and XP; didn't try it on W9x).
ASKER CERTIFIED SOLUTION
Avatar of Tim Holman
Tim Holman
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Some useful links there.  Thanks.
-- Dan