473,498 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File.Move large binary file

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
Nov 21 '05 #1
5 4819
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.

Nov 21 '05 #2
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 Stacey [MVP]

"kids_pro" <ki******@yahoo.com> wrote in message
news:Ou**************@TK2MSFTNGP15.phx.gbl...
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

Nov 21 '05 #3
William Stacey [MVP] wrote:
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.
Nov 23 '05 #4
yes. Examples should be on google.

--
William Stacey [MVP]

"kids_pro" <ki******@yahoo.com> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl...
William Stacey [MVP] wrote:
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.

Nov 23 '05 #5
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.

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2597
by: spike | last post by:
Im writing a program to search for a string in a binary file. And it works. The problem is: It is sooo slow! how can i make it faster? It takes 27 seconds just to search a 5 meg file. I guess it...
2
4178
by: TOI DAY | last post by:
I have a large file, I want to be to open the first file in a stream, read a chunk (say 1024 bytes) and stick it in a byte array, open the second file in a different stream, read a chuck (the same...
15
1723
by: Yogi_Bear_79 | last post by:
Visual Studio .NET started complaing when the array was around 4000. I found that if I pasted the array in via notepad then opened Visual Studio it would work. Now my array is over 26,000 and...
1
5348
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
1
3037
by: Matthew Eno | last post by:
I have a problem where I'm developing some code that moves files from one place to another (on the same drive) with the destination file having a new name. What's happening is that the line of...
2
4605
by: gauravkhanna | last post by:
Hi All I need some help for the below problem: Scenario We need to send large binary files (audio file of about 10 MB or so) from the client machine (.Net Windows based application, located...
6
5089
by: Brybot | last post by:
I am trying to allow HTTP POST file uploads to my web service. Currently I have it working perfectly for a SOAP/XML request reading in a byte using MemoryStream/FileStream but I cannot figure out...
31
2458
by: broli | last post by:
I need to parse a file which has about 2000 lines and I'm getting told that reading the file in ascii would be a slower way to do it and so i need to resort to binary by reading it in large...
11
3777
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.