Browse files

add functionality to remove_sauce_file()

  • Loading branch information...
1 parent 519e785 commit 9b8e3d757c56ee0460a460653b616b626058b65e @bricas committed Mar 29, 2010
Showing with 6 additions and 2 deletions.
  1. +0 −1 TODO
  2. +5 −1 src/libsauce.c
  3. +1 −0 src/libsauce.h
View
1 TODO
@@ -1,3 +1,2 @@
create write functions
-create remove functions
add documentation
View
6 src/libsauce.c
@@ -173,6 +173,10 @@ int sauce_remove_file( FILE *file ) {
return 0;
}
- /* truncate to record->filesize */
+ if( ftruncate( fileno( file ), record->filesize ) != 0 ) {
+ printf( "Truncate failed" );
+ exit( 1 );
+ }
+
return 0;
}
View
1 src/libsauce.h
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#ifndef LIBSAUCE_H
#define LIBSAUCE_H

0 comments on commit 9b8e3d7

Please sign in to comment.