Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Large Files

Large Files

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andre1234
    wrote on last edited by
    #1

    I need to process large files (> 2Gig). The regular C functions "fopen" or MFC CFile operate with a long value offset which limits the file to 2**31. Is their a other option than using low level routines ( _open, _lseek, ...) ? Andre

    I D V N 4 Replies Last reply
    0
    • A Andre1234

      I need to process large files (> 2Gig). The regular C functions "fopen" or MFC CFile operate with a long value offset which limits the file to 2**31. Is their a other option than using low level routines ( _open, _lseek, ...) ? Andre

      I Offline
      I Offline
      Ian Darling
      wrote on last edited by
      #2

      Try SetFilePointer and/or SetFilePointerEx with the normal Win32 file functions. CFile may have these methods too (or you could probably use the underlying file handle of the CFile object with the SetFilePointer functions) HTH -- Ian Darling "The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky

      1 Reply Last reply
      0
      • A Andre1234

        I need to process large files (> 2Gig). The regular C functions "fopen" or MFC CFile operate with a long value offset which limits the file to 2**31. Is their a other option than using low level routines ( _open, _lseek, ...) ? Andre

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        In addition to Ian's suggestion, this article might be of interest.


        Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

        A 1 Reply Last reply
        0
        • A Andre1234

          I need to process large files (> 2Gig). The regular C functions "fopen" or MFC CFile operate with a long value offset which limits the file to 2**31. Is their a other option than using low level routines ( _open, _lseek, ...) ? Andre

          V Offline
          V Offline
          Vitali Halershtein
          wrote on last edited by
          #4

          One of the possible ways is to write wapper class similar CFile specially assigned to manipulate with VLF. F.e. - inside, this class could use 64-bit lo-level functions. Thanks for the interesting question. Vitali http://www.creative-case.com

          1 Reply Last reply
          0
          • D David Crow

            In addition to Ian's suggestion, this article might be of interest.


            Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

            A Offline
            A Offline
            Andre1234
            wrote on last edited by
            #5

            Thank you for the info. CFile64 needed integration, but did the trick! (Will I ever need CFile128?)

            D 1 Reply Last reply
            0
            • A Andre1234

              Thank you for the info. CFile64 needed integration, but did the trick! (Will I ever need CFile128?)

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              Andre1234 wrote: Will I ever need CFile128? If you do, just check back here and I'll suggest it to you!


              Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

              1 Reply Last reply
              0
              • A Andre1234

                I need to process large files (> 2Gig). The regular C functions "fopen" or MFC CFile operate with a long value offset which limits the file to 2**31. Is their a other option than using low level routines ( _open, _lseek, ...) ? Andre

                N Offline
                N Offline
                n 0
                wrote on last edited by
                #7

                Use CreateFile() & CloseHandle() Phil

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups