Abou creating a FILE with fixed SIZE

Hi friends,

i have one question related with file.

Q: how to create a file with specified size.?

        if for example, file size is 500k. If we are writing in to a file, how to know that file size is reached upto 80% of max file size, which we mentioned file siaze while creating.?

Try truncate() and i beleive u can keep track how many bytes ur writing to the file.

you can fopen() a new file,
then fseek() a specified size,
then fclose() this file.
finally you get a file with specified size.

later when you will write the file, you can use ftell() to get the position of file pointer.