From 430524810e67d3c223a2ab819f45b882b419c45d Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 14 Jun 2005 12:29:40 +0000 Subject: Incorporated the use of the Info object everywhere... also using the log functionality. --- src/file.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/file.cc') diff --git a/src/file.cc b/src/file.cc index 1a94150..813a041 100644 --- a/src/file.cc +++ b/src/file.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.3 2005/06/14 12:29:40 deva + * Incorporated the use of the Info object everywhere... also using the log functionality. + * * Revision 1.2 2005/06/13 20:38:19 deva * Added some logfile code. * Enhanced the file object... now ready to hook into mov_encoder @@ -120,7 +123,7 @@ int File::Open() seqnum ++; - info->log("Opened the file %s for output.\n", fname); + info->log("Opened the file %s for output.", fname); return 0; } @@ -137,7 +140,7 @@ int File::Write(void* data, int size) w = write(fd, data, size); if(w != size) { info->error("Out of diskspace!\n"); - exit(1); + return -1; } } @@ -155,13 +158,14 @@ int File::createPath(char* path) subpath[strrchr(subpath, '/') - subpath] = '\0'; - printf("%s\n", path); + info->info("Checking and/or generating directory: %s", path); if(strlen(subpath) > 0) createPath(subpath); // stat(path, &stats); //if(!S_ISDIR(stats.st_mode) && S_ISREG(stats.st_mode)) mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IXOTH | S_IROTH); + // TODO: Check for creation errors! free(subpath); -- cgit v1.2.3