473,661 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy files - buffered streams vs File.Copy

1 New Member
Hi,
I need to implement a high performance file copying.
The File.Copy method in .NET is fast enough however I need to control the speed since it should be performed in the background without affecting the process too much.
I've implemented a buffered (FileStream) copy using a queue for the bufferes.
The performance is about 60% slower than the File.Copy.

I've heard something about unbuffered stream, however I couldn't find anything usefull in the net.
Can anyone spread his wisdom one this method?
Any idea how can I improve the buffered copy mechanism?

Thanks a lot.
Apr 3 '08 #1
1 2242
r035198x
13,262 MVP
Hi,
I need to implement a high performance file copying.
The File.Copy method in .NET is fast enough however I need to control the speed since it should be performed in the background without affecting the process too much.
I've implemented a buffered (FileStream) copy using a queue for the bufferes.
The performance is about 60% slower than the File.Copy.

I've heard something about unbuffered stream, however I couldn't find anything usefull in the net.
Can anyone spread his wisdom one this method?
Any idea how can I improve the buffered copy mechanism?

Thanks a lot.
I haven't got your requirements correctly yet, sorry I always seem to miss the obvious.
Do you want your "buffered copy mechanism" to go faster or slower than the File.Copy method?
Also by "improving" it, do you mean you want it to be faster than it is now?
If that's the case, then you'll need to post how you've done it so that people can see where to improve.
Apr 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

19
4659
by: Claudio Grondi | last post by:
I would like to save time copying the same file (>6 GByte) to various different target storage media connected to the system via USB. Is there a (Python or other) tool able to help me to do this, so that I don't need to copy the source file first to the first media, then to the second, etc.? Claudio
8
3011
by: MattP | last post by:
Ok, with the help of some examples found on the web and some minor modifications on our own, we have a simple and working encrypt and decrypt solution. It runs as a service, watches for files with a specific extension in a specific directory. The files are uploaded by FTP to this directory. The service then does the following steps: 1) Verify it can open the file (so we know it's fully uploaded). 2) Try to decrypt the file with known...
7
2336
by: Steven T. Hatton | last post by:
I haven't looked very closely, but from what I'm seeing, it looks like there are no buffered I/O streams in the Standard Library. There are stream buffers, but not buffered streams. I don't have an excellent definition of what a buffered stream is right off the top of my head, but it's something like a cache that can hold data from the source, or for the destination that can't be immediately processed. Say, for example, if you are...
2
3982
by: Toby Doig | last post by:
When I try to import data from a unicode file into PostgreSQL 7.4 under FreeBSD it appears to now understand the Unicode file format. To demonstrate I export a set of Integers into a Unicode file from MSSQL 2000. I samba the file to a FreeBSD box and try to import from psql with COPY. It fails. Wordpad and Notepad both read the file ok, even after I bounce the file via the FreeBSD box (to test samba didn't munge it). FreeBSD 5.1-RELEASE #0...
9
3996
by: kernelxu | last post by:
hi,everybody. I calling function setbuf() to change the characteristic of standsrd input buffer. some fragment of the progrem is: (DEV-C++2.9.9.2) #include <stdio.h> #include <stdlib.h> int main(void) { char buf = {0};
1
2595
by: Jorge Ribeiro | last post by:
Hello I've an ASP.NET Web application that has one form where the user can upload a file to be sent and saved on a database. The app sends the file via DIME attachments and SOAP envelopes to a Web Service that reads that package and records the file on a specific record in a database. It all goes well when my files are smaller than 4Mb. Files larger than that origins a error message of "File extends size limits" or something like that
4
3359
by: hzgt9b | last post by:
Usig VB .NET 2003, I'm writing a simple app that copies 1 or more files. Requiremtns state that I need two progress bars one for current file copy progress and one for overall progress. My problem is that I'm not sure how to obtain progress about a file as it is being copied. I've read some thread about using the SHFileOperation API but I'm lost as to how to implemt that in .NET. Can someone give me a pointer to some doco? Also an...
9
6866
by: Justin Rich | last post by:
looking for the best approach to reading a real time log file. The file gets updated pretty quickly, always appended to the end. do i really need to just keep re-opening the file and reading the end of it? I cant help but think there is a better way to go about this. any suggestions would be greatly appreciated. Thanks
4
2314
by: per9000 | last post by:
Hi python people, I am trying to figure out the best way to encrypt files in python. I've build a small script (see below) that encrypts the ubuntu 7.04 iso file in 2 minutes (I like python :) ). But I have some thoughts about it. By pure luck (?) this file happened to be N*512 bytes long so I do not have to add crap at the end - but on files of the size N*512 + M (M != 521) I will add some crap to make
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8855
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7364
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1743
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.