From: Josh Coalson Date: Thu, 7 Jun 2001 20:00:50 +0000 (+0000) Subject: add flac__file_get_filesize() X-Git-Tag: 1.2.0~2272 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fa53d62113baaa11342893014f2602c51b4dd8e;p=platform%2Fupstream%2Fflac.git add flac__file_get_filesize() --- diff --git a/src/flac/file.c b/src/flac/file.c index 8727414..03adab1 100644 --- a/src/flac/file.c +++ b/src/flac/file.c @@ -42,3 +42,13 @@ void flac__file_copy_metadata(const char *srcpath, const char *destpath) #endif } } + +off_t flac__file_get_filesize(const char *srcpath) +{ + struct stat srcstat; + + if(0 == stat(srcpath, &srcstat)) + return srcstat.st_size; + else + return -1; +} diff --git a/src/flac/file.h b/src/flac/file.h index 6171ef6..0b12800 100644 --- a/src/flac/file.h +++ b/src/flac/file.h @@ -20,5 +20,6 @@ #define flac__file_h void flac__file_copy_metadata(const char *srcpath, const char *destpath); +off_t flac__file_get_filesize(const char *srcpath); #endif