Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can I make my program find out the size of a file in bytes?

I want my program to figure out the size of a file in bytes and then store the size for later use.

How would I do this?

Comments

  • stoberstober Member Posts: 9,765 ✭✭✭
    : I want my program to figure out the size of a file in bytes and then store the size for later use.
    :
    : How would I do this?
    :

    There are several ways to do it, but the most standardized way us the _stat() function. it wills in a structure that, among other thigs, has the file size.
  • ScriptStar2063ScriptStar2063 Member Posts: 65
    : : I want my program to figure out the size of a file in bytes and then store the size for later use.
    : :
    : : How would I do this?
    : :
    :
    : There are several ways to do it, but the most standardized way us the _stat() function. it wills in a structure that, among other thigs, has the file size.
    :

    I am writing this for a dos program in C. What do I have to include for header files and what are the parameters for the function.
  • ScriptStar2063ScriptStar2063 Member Posts: 65
    : : I want my program to figure out the size of a file in bytes and then store the size for later use.
    : :
    : : How would I do this?
    : :
    :
    : There are several ways to do it, but the most standardized way us the _stat() function. it wills in a structure that, among other thigs, has the file size.
    :

    I am writing this for a dos program in C. What do I have to include for header files and what are the parameters for the function?
  • stoberstober Member Posts: 9,765 ✭✭✭
    :
    : I am writing this for a dos program in C. What do I have to include for header files and what are the parameters for the function.
    :


    [blue]look them up in MSDN at www.msdn.microsoft.com. I'm not being an ahole abut this, but instead want you to learn how to find the answers to your questions. We all go through that too.
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : : I want my program to figure out the size of a file in bytes and then store the size for later use.
    : : :
    : : : How would I do this?
    : : :
    : :
    : : There are several ways to do it, but the most standardized way us the _stat() function. it wills in a structure that, among other thigs, has the file size.
    : :
    :
    : I am writing this for a dos program in C. What do I have to include for header files and what are the parameters for the function?
    :
    [blue]I remember [b]Turbo C[/b] had [b]findfirst()[/b] for that. [b]DIR.H[/b] should be included.[/blue]
Sign In or Register to comment.