File.Move large binary file

  • Thread starter Thread starter kids_pro
  • Start date Start date
K

kids_pro

Hi,

How does File.Move implmented?
I am like to use it a lot but when I come a cross a large file >500 MB
my UI is freezed.

I think about implement my own fileMove function but I am not sure what
is the efficient way to implement it. There are many thing in the
System.IO such as BinaryRead, BinaryWrite FileStream etc.

Please advice me on how to handle file.move for large binary file.

Many thanks,
kids
 
Even if you implement your own function, UI is still likely to hang
unless you make use of async IO. I think it is better to still use
File.Move, but call it on a different thread.
 
When the file is in the same partition, it is renamed. When on different
partitions, the file is copied and then deleted from source. For large
files, this is just going to take time, so I would not do this operation on
the UI thread. Create a backgroundworker.
 
William said:
When the file is in the same partition, it is renamed. When on different
partitions, the file is copied and then deleted from source. For large
files, this is just going to take time, so I would not do this operation on
the UI thread. Create a backgroundworker.
Is it possible to show the progress (in progress bar) during file move?
Go backgroundworker way.
 
More on this, note that you don't know the actual progress of
File.Move. You could guess that base on the file size, but it is not
exact. Maybe better just displaying a label saying file is copying.
 
Back
Top