how to calculate the logical length of a file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bajajv
    New Member
    • Jun 2007
    • 152

    how to calculate the logical length of a file?

    How can we get the logical length of a file using fstream? Like In windows, we can use the getlength() function of CFile. How to do the same with fstream?
  • bajajv
    New Member
    • Jun 2007
    • 152

    #2
    Also, what is the logical length of a file? Is size and length same when spoken about files?

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      I have ni idea what Microsoft mean by "logical length" as opposed to size.

      You can get the size of a file by opening it (in binary mode), seeking (fseek) to the end of it and then getting the current file pointer position (ftell).

      Comment

      Working...