summaryrefslogtreecommitdiff
path: root/src/file.h
diff options
context:
space:
mode:
authorDavid <david@xagasoft.com>2007-06-18 20:45:45 +0000
committerDavid <david@xagasoft.com>2007-06-18 20:45:45 +0000
commit6f94639a3f5e20e1c635b2d8676086464d7cba2e (patch)
tree26d849636f58d5523c51776ad920781429a6df73 /src/file.h
parentf58a0b3a1f657124076b96ba092e1f69e88af263 (diff)
downloadlibbu++-6f94639a3f5e20e1c635b2d8676086464d7cba2e.tar.gz
libbu++-6f94639a3f5e20e1c635b2d8676086464d7cba2e.tar.bz2
libbu++-6f94639a3f5e20e1c635b2d8676086464d7cba2e.tar.xz
libbu++-6f94639a3f5e20e1c635b2d8676086464d7cba2e.zip
david - did more documenting
Diffstat (limited to 'src/file.h')
-rw-r--r--src/file.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/file.h b/src/file.h
index fe8dbda..1a4421b 100644
--- a/src/file.h
+++ b/src/file.h
@@ -39,6 +39,14 @@ namespace Bu
39 virtual bool isBlocking(); 39 virtual bool isBlocking();
40 virtual void setBlocking( bool bBlocking=true ); 40 virtual void setBlocking( bool bBlocking=true );
41 41
42 /**
43 * Create a temp file and return its handle
44 *@param sName (Bu::FString) Give in the form: "/tmp/tmpfileXXXXXXXX"
45 * It will alter your (sName) setting the 'X's to random
46 * characters.
47 *@param sFlags (const char *) Standard file flags 'rb'... etc..
48 *@returns (Bu::File) A file object representing your temp file.
49 */
42 inline static Bu::File tempFile( Bu::FString &sName, const char *sFlags ) 50 inline static Bu::File tempFile( Bu::FString &sName, const char *sFlags )
43 { 51 {
44 int afh_d = mkstemp( sName.getStr() ); 52 int afh_d = mkstemp( sName.getStr() );
@@ -46,7 +54,17 @@ namespace Bu
46 return Bu::File( afh_d, sFlags ); 54 return Bu::File( afh_d, sFlags );
47 } 55 }
48 56
57 /**
58 * Set the size of the file to (nSize). You can either grow or shrink
59 * the file.
60 *@param nSize (long) The new size of the file.
61 */
49 void truncate( long nSize ); 62 void truncate( long nSize );
63
64 /**
65 * Change the file access permissions.
66 *@param t (mode_t) The new file access permissions.
67 */
50 void chmod( mode_t t ); 68 void chmod( mode_t t );
51 69
52 private: 70 private: