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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Create file and set size

Create file and set size

Scheduled Pinned Locked Moved C / C++ / MFC
help
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.
  • N Offline
    N Offline
    NewVC
    wrote on last edited by
    #1

    Hi All I want to create a .txt file and set it size like 10mb.Can any one give me artical.Plz help me

    H S D 3 Replies Last reply
    0
    • N NewVC

      Hi All I want to create a .txt file and set it size like 10mb.Can any one give me artical.Plz help me

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      You can use of CStdioFile Class or CFile class for make file but I dont think its possible to set size. its possible with Naveen's answer. ;)

      modified on Wednesday, October 15, 2008 1:56 AM

      N 1 Reply Last reply
      0
      • H Hamid Taebi

        You can use of CStdioFile Class or CFile class for make file but I dont think its possible to set size. its possible with Naveen's answer. ;)

        modified on Wednesday, October 15, 2008 1:56 AM

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        Hamid. wrote:

        I dont think its possible to set size

        it is possible with CFile::SetLength[^] function.

        nave [OpenedFileFinder] [My Blog]

        H N 2 Replies Last reply
        0
        • N Naveen

          Hamid. wrote:

          I dont think its possible to set size

          it is possible with CFile::SetLength[^] function.

          nave [OpenedFileFinder] [My Blog]

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          I forgot it. :-D

          1 Reply Last reply
          0
          • N NewVC

            Hi All I want to create a .txt file and set it size like 10mb.Can any one give me artical.Plz help me

            S Offline
            S Offline
            Saurabh Garg
            wrote on last edited by
            #5

            Can you tell us what are you trying to achieve? What purpose does it server to manually set the size of a file? -Saurabh

            1 Reply Last reply
            0
            • N Naveen

              Hamid. wrote:

              I dont think its possible to set size

              it is possible with CFile::SetLength[^] function.

              nave [OpenedFileFinder] [My Blog]

              N Offline
              N Offline
              NewVC
              wrote on last edited by
              #6

              Thanks it's working

              1 Reply Last reply
              0
              • N NewVC

                Hi All I want to create a .txt file and set it size like 10mb.Can any one give me artical.Plz help me

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

                See here. Use of an edit control is optional. You may also want to look at SetFilePointer() followed by SetEndOfFile().

                "Love people and use things, not love things and use people." - Unknown

                "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                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