looking for a fast "move" method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gina_Marano

    looking for a fast "move" method

    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\myfo lder\a\largefil e.txt
    to: \\myserver\myfo lder\b\largefil e.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("shel l32.dll", CharSet = CharSet.Unicode )]
    static extern int SHFileOperation ([In] ref SHFILEOPSTRUCT
    lpFileOp);

    Any thoughts?

    -Gina_M

  • GArlington

    #2
    Re: looking for a fast "move&quot ; method

    On Sep 26, 1:06 am, Gina_Marano <ginals...@gmai l.comwrote:
    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\myfo lder\a\largefil e.txt
    to: \\myserver\myfo lder\b\largefil e.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("shel l32.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\myf older\" but I do not know
    if this will help...

    Comment

    • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

      #3
      RE: looking for a fast &quot;move&quot ; method

      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.


      --
      Ciaran O''Donnell
      try{ Life(); } catch (TooDifficultException) { throw Toys(); }



      "Gina_Maran o" wrote:
      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\myfo lder\a\largefil e.txt
      to: \\myserver\myfo lder\b\largefil e.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("shel l32.dll", CharSet = CharSet.Unicode )]
      static extern int SHFileOperation ([In] ref SHFILEOPSTRUCT
      lpFileOp);
      >
      Any thoughts?
      >
      -Gina_M
      >
      >

      Comment

      • Gina_Marano

        #4
        Re: looking for a fast &quot;move&quot ; method

        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

        Comment

        Working...