| delorie.com/archives/browse.cgi | search |
| Date: | Sun, 16 Feb 1997 15:13:18 -0600 (CST) |
| From: | "Mr. Fuju" <kapieckiel AT Harding DOT edu> |
| Subject: | File sizes... |
| To: | djgpp AT delorie DOT com |
| Message-id: | <Pine.SOL.3.94.970216151018.22732B-100000@taz> |
| MIME-version: | 1.0 |
If I use open () to open an existing file, how do I determine the
filesize? I am not attaching the file to a stream. Here is my code:
---------------- cut here -------------------
#include <unistd.h>
#include <fcntl.h>
int file1; // file descriptors
long filesize;
void main (void)
{
file1 = open ("test.file", O_RDWR | O_CREAT, 0600);
// filesize is set here...
close (file1);
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |