looking for a fast "move" method

G

Gina_Marano

Hey all,

It appears that if I File.Move a large file 1GB from one network
location to another location it is really slow.

example.

from: \\myserver\myfolder\a\largefile.txt
to: \\myserver\myfolder\b\largefile.txt

same machine, same hard drive, same partition... it takes 30+ seconds

If I cut/paste using windows explorer it is faster than I can snap.

I have tried File.Move and

[DllImport("shell32.dll", CharSet = CharSet.Unicode)]
static extern int SHFileOperation([In] ref SHFILEOPSTRUCT
lpFileOp);

Any thoughts?

-Gina_M
 
G

GArlington

Hey all,

It appears that if I File.Move a large file 1GB from one network
location to another location it is really slow.

example.

from: \\myserver\myfolder\a\largefile.txt
to: \\myserver\myfolder\b\largefile.txt

same machine, same hard drive, same partition... it takes 30+ seconds

If I cut/paste using windows explorer it is faster than I can snap.

I have tried File.Move and

        [DllImport("shell32.dll", CharSet = CharSet.Unicode)]
        static extern int SHFileOperation([In] ref SHFILEOPSTRUCT
lpFileOp);

Any thoughts?

-Gina_M

With network notation I do not think there is a way for the operation
to check the the source and destination are on the same drive, you can
map separate drives this way easily, so I suspect that your program is
doing copy, write new file in destination, delete source file
sequence.
You can try to map a drive to "\\myserver\myfolder\" but I do not know
if this will help...
 
C

Ciaran O''Donnell

Doing a move on a remote machine will copy everything to the new file VIA
your machine and then delete the old file. Doing it ON the machine the file
is on will just edit the file allocation table. The fastest way to do this is
locally on the machine hosting the file.
 
G

Gina_Marano

Thanks All for the help.

GArlington was correct. It did have something to do with the network
notation. The network guys did something and now 1GB move is almost
instantaneous.

-Gina_M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top