Thread: Best way to see file's size

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Microsoft also has integer-64 versions of the fseek/ftell functions.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    Microsoft also has integer-64 versions of the fseek/ftell functions.
    You mean _teilli64() - that's not a version of ftell() - it's a version of the linux tell() function.

    But I also realized that fsetpos is not analogous to fseek in that it takes an absolute file position, so there's no way to say "move to 0 bytes from the end of the file".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No, I mean _ftelli64 and _fseeki64.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    No, I mean _ftelli64 and _fseeki64.
    Ah, yes, found those now - somehow, when I was looking at fsetpos, it didn't have _fseeki64. Googling for that specifically does however show it up.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #20
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by matsp View Post
    I can't think of a reasonable solution to that one. Although I predict that this would also not work reliably for other fseek-related operations, so wouldn't that filesystem/disk driver be "black-flagged"?
    Such systems still have a significant market share. The real world is like that sometimes: the technically best or even right is not necessarily what survives.

  6. #21
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by grumpy View Post
    Such systems still have a significant market share. The real world is like that sometimes: the technically best or even right is not necessarily what survives.
    Just out of curiosity, what systems are those? I just can't understand how you would be able to for example build a working database system with a seek function that "doesn't always work". Or are we talking only on certain types of media (say CD-ROM or tape)?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  3. char problem
    By eXistenZ in forum Windows Programming
    Replies: 36
    Last Post: 02-21-2005, 06:32 AM
  4. Replies: 11
    Last Post: 03-25-2003, 05:13 PM
  5. Size of exe files
    By Korn1699 in forum C++ Programming
    Replies: 6
    Last Post: 03-25-2002, 09:46 PM