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. Getting size of file?

Getting size of file?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 4 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.
  • M Offline
    M Offline
    Moochie5
    wrote on last edited by
    #1

    I am opening and reading from a text file and am trying to figure out the function to get the size of the file. Windows reports the file as being 33KB, and I want my program to be able to report that as well. Appreciate the help.

    R D 2 Replies Last reply
    0
    • M Moochie5

      I am opening and reading from a text file and am trying to figure out the function to get the size of the file. Windows reports the file as being 33KB, and I want my program to be able to report that as well. Appreciate the help.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      CFile::GetStatus() /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

      N 1 Reply Last reply
      0
      • R Ravi Bhavnani

        CFile::GetStatus() /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        N Offline
        N Offline
        Neville Franks
        wrote on last edited by
        #3

        Or lseek() to end of the file or ftell() for the old fashioned streams. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

        1 Reply Last reply
        0
        • M Moochie5

          I am opening and reading from a text file and am trying to figure out the function to get the size of the file. Windows reports the file as being 33KB, and I want my program to be able to report that as well. Appreciate the help.

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

          GetFileSize() comes to mind.


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          M 1 Reply Last reply
          0
          • D David Crow

            GetFileSize() comes to mind.


            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            M Offline
            M Offline
            Moochie5
            wrote on last edited by
            #5

            Thanks everyone. GetStatus worked.

            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