36 $this->handle = fopen( $file,
"wt" );
37 $this->filename = $file;
44 parent::writeCloseStream( $string );
45 if ( $this->handle ) {
46 fclose( $this->handle );
47 $this->handle =
false;
55 fputs( $this->handle, $string );
70 if ( !rename( $this->filename, $newname ) ) {
71 throw new MWException( __METHOD__ .
": rename of file {$this->filename} to $newname failed\n" );
81 if ( is_array( $newname ) ) {
82 if (
count( $newname ) > 1 ) {
83 throw new MWException( __METHOD__ .
": passed multiple arguments for rename of single file\n" );
85 $newname = $newname[0];
98 if ( $this->handle ) {
99 fclose( $this->handle );
100 $this->handle =
false;
104 $this->handle = fopen( $this->filename,
"wt" );