]> mj.ucw.cz Git - libucw.git/blob - ucw/io-size.c
Use #include <ucw/...> instead of "ucw/..." (and similarly for the other libs)
[libucw.git] / ucw / io-size.c
1 /*
2  *      UCW Library -- File Sizes
3  *
4  *      (c) 1999--2012 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #include <ucw/lib.h>
11 #include <ucw/io.h>
12
13 ucw_off_t ucw_file_size(const char *name)
14 {
15   int fd = ucw_open(name, O_RDONLY);
16   if (fd < 0)
17     die("Cannot open %s: %m", name);
18   ucw_off_t len = ucw_seek(fd, 0, SEEK_END);
19   close(fd);
20   return len;
21 }