Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 268811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:44:21+00:00 2026-05-11T23:44:21+00:00

Our .NET app copies large files, and needs to give the user feedback; so

  • 0

Our .NET app copies large files, and needs to give the user feedback; so rather than use File.Copy we read a chunk of one file and write it to the other, and display the progress after each chunk. Nothing out of the ordinary. But what’s the right size of chunk to use, to give the fastest file copy, assuming the time to display the progress is negligible?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T23:44:21+00:00Added an answer on May 11, 2026 at 11:44 pm

    You should consider using win32 function CopyFileTransacted (Vista Only) or CopyFileEx (Windows 2000 and higher). These are provided by Windows and are optimized for speed.

    I would recommend you to test your custom C# implementation performance and compare it to native File.Copy performance. If the performance is comparable (i.e. same order of magnitude) than go with your custom C# implementation. Otherwise it’s better to use CopyFileTransacted or CopyFileEx function.

    P.s. from here:

    [return: MarshalAs(UnmanagedType.Bool)]
    [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
    internal static extern bool CopyFileTransacted([In] string lpExistingFileName, [In] string lpNewFileName, [In] IntPtr lpProgressRoutine, [In] IntPtr lpData, [In, MarshalAs(UnmanagedType.Bool)] ref bool pbCancel, [In] CopyFileFlags dwCopyFlags, [In] KtmTransactionHandle hTransaction);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our company has a fairly large ASP.NET web application. The app is already broken
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and
We have CC.NET setup on our ASP.NET app. When we build the project, the
Just started getting a bunch of errors on our C# .Net app that seemed
My team is considering building our next web app using the ASP.NET MVC framework.
Got a problem with ADOMD.NET 8.0, SQL2008 and our app. It isn't giving us
We are trying to get our .NET devs to use the ASP.NET Development Server
Our team (5-10 developers) plans to adopt Subversion for our .NET (Visual Studio) projects/solutions
We're using our .NET Assembly DLL within native C++ through COM (CCW). Whenever I
I'm evaluating options to make our search more powerful on our .Net website. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.