Show progress for copy file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    Show progress for copy file

    i am copying a file which is nearly 10 MB through FileSystemObjec t. It is a single file, is it possible to show progress bar for that file.


    Front-End : VB 6.0
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by hariharanmca
    i am copying a file which is nearly 10 MB through FileSystemObjec t. It is a single file, is it possible to show progress bar for that file.

    Front-End : VB 6.0
    I don't believe so. After all, from your point of view it's a single action, right?

    What I'd recommend is to do the copy "manually". That is, open input and output files as Binary, and use Get/Put to transfer a nice large chunk at a time. That way, you can do a progress display. The larger the chunks, the faster the transfer, but how much RAM do you want to use up, and how slow is each read/write action?

    I'm guessing this must be via a fairly slow mechanism? 10MB is pretty small by present standards. Copying the file on a slow HDD shouldn't take more than a second or two.

    Comment

    • hariharanmca
      Top Contributor
      • Dec 2006
      • 1977

      #3
      Originally posted by Killer42
      I don't believe so. After all, from your point of view it's a single action, right?

      What I'd recommend is to do the copy "manually". That is, open input and output files as Binary, and use Get/Put to transfer a nice large chunk at a time. That way, you can do a progress display. The larger the chunks, the faster the transfer, but how much RAM do you want to use up, and how slow is each read/write action?

      I'm guessing this must be via a fairly slow mechanism? 10MB is pretty small by present standards. Copying the file on a slow HDD shouldn't take more than a second or two.
      No, for sample I gave like that.

      Because for multiple files, I can count the file and show the progress. But here (It is an MAYA Rendering files its size is min 100 MB to 2 GB some will be 10 MB). So I have to copy those files in some conditions. Here I have to get each file size and show two progress bars.
      1. current file
      2. total files done

      Comment

      • danp129
        Recognized Expert Contributor
        • Jul 2006
        • 323

        #4
        Originally posted by hariharanmca
        i am copying a file which is nearly 10 MB through FileSystemObjec t. It is a single file, is it possible to show progress bar for that file.


        Front-End : VB 6.0

        Originally posted by http://www.microsoft.c om/technet/scriptcenter/guide/sas_scr_klwf.ms px?mfr=true
        Because CopyFolder is a single operation, there is no way to track its progress; you simply have to wait until the operation has finished. If you want to monitor the progress of the copy command, you should use the Shell Application object instead. This object is discussed in "Files and Folders" in this book.
        Personally, I would use copyfile API

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by danp129
          Personally, I would use copyfile API
          Why? Does that show the standard Windows progress dialogue? If so, that would be quite handy.

          Though it might be nice if Windows could give more reasonable estimates. It once told me I had something like 17 million seconds remaining.

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by Killer42
            Why? Does that show the standard Windows progress dialogue? If so, that would be quite handy.

            Though it might be nice if Windows could give more reasonable estimates. It once told me I had something like 17 million seconds remaining.

            I think it will be happen if I get the file size and that file copied size.
            S it possible to get it by VB code.

            Comment

            Working...