39 $this->handle = fopen( $file,
"wt" );
40 $this->filename = $file;
47 parent::writeCloseStream( $string );
48 if ( $this->handle ) {
49 fclose( $this->handle );
50 $this->handle =
false;
57 public function write( $string ) {
58 fputs( $this->handle, $string );
72 if ( !rename( $this->filename, $newname ) ) {
73 throw new RuntimeException( __METHOD__ .
": rename of file {$this->filename} to $newname failed\n" );
83 if ( is_array( $newname ) ) {
84 if ( count( $newname ) > 1 ) {
85 throw new MWException( __METHOD__ .
": passed multiple arguments for rename of single file\n" );
87 $newname = $newname[0];
98 if ( $this->handle ) {
99 fclose( $this->handle );
100 $this->handle =
false;
104 $this->handle = fopen( $this->filename,
"wt" );
checkRenameArgCount( $newname)
writeCloseStream( $string)
closeRenameAndReopen( $newname)
Close the old file, move it to a specified name, and reopen new file with the old name....
renameOrException( $newname)
closeAndRename( $newname, $open=false)
Close the old file, and move it to a specified name.Use this for the last piece of a file written out...