add flac__file_get_filesize()
authorJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 7 Jun 2001 20:00:50 +0000 (20:00 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 7 Jun 2001 20:00:50 +0000 (20:00 +0000)
src/flac/file.c
src/flac/file.h

index 8727414..03adab1 100644 (file)
@@ -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;
+}
index 6171ef6..0b12800 100644 (file)
@@ -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