Changeset 247 for trunk/includes/stream.php
- Timestamp:
- Jul 15, 2009, 1:36:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/stream.php
r120 r247 21 21 public function OpenFile($FileName) 22 22 { 23 23 $this->FileName = $FileName; 24 24 $this->CloseFile(); 25 25 $this->Handle = fopen($FileName, 'rb'); … … 29 29 public function CreateFile($FileName) 30 30 { 31 31 $this->FileName = $FileName; 32 32 $this->CloseFile(); 33 33 $this->Handle = fopen($FileName, 'wb+'); … … 81 81 public function WriteUint($Value) 82 82 { 83 83 fwrite($this->Handle, pack('V*', $Value), 4); 84 84 } 85 85 86 86 public function WriteInt($Value) 87 87 { 88 88 fwrite($this->Handle, pack('I*', $Value), 4); 89 89 } 90 90 … … 101 101 public function WriteString($Value) 102 102 { 103 104 103 fwrite($this->Handle, $Value); 104 fwrite($this->Handle, "\0", 1); 105 105 } 106 106 … … 117 117 public function GetPosition() 118 118 { 119 119 return(ftell($this->Handle)); 120 120 } 121 121 122 122 public function GetSize() 123 123 { 124 124 return(filesize($this->FileName)); 125 125 } 126 126 127 127 public function EOF() 128 128 { 129 129 return(feof($this->Handle)); 130 130 } 131 131 }
Note:
See TracChangeset
for help on using the changeset viewer.