| 187 | | |
| | 187 | ==== Parameters ==== |
| | 188 | * strFilename - string filename to delete |
| | 189 | * pszFilename - pointer to null terminated character array filename to delete |
| | 190 | |
| | 191 | ==== Return value ==== |
| | 192 | Returns true if successful, false if not successful. |
| | 193 | |
| | 194 | ==== Remarks ==== |
| | 195 | |
| | 196 | Versions of this fuctions that accept a filename are static so they do not require an CFile object. |
| | 197 | |
| | 198 | ==== Examples ==== |
| | 199 | |
| | 200 | {{{ |
| | 201 | string str = "/tmp/tmpfile"; |
| | 202 | CFile::DeleteFile(str); |
| | 203 | }}} |
| | 204 | |
| | 205 | {{{ |
| | 206 | if(CFile::DeleteFile("/tmp/tmpfile") == false) |
| | 207 | { |
| | 208 | DisplayText(0, 0, "Delete file error"); |
| | 209 | } |
| | 210 | }}} |
| | 211 | |
| | 212 | {{{ |
| | 213 | CFile file("/tmp/tmpfile", "w"); |
| | 214 | if(file.IsOpen()) |
| | 215 | { |
| | 216 | file.Print("This will not exist very long\r\n"); |
| | 217 | SleepSeconds(1); |
| | 218 | file.Close(); |
| | 219 | SleepSeconds(1); |
| | 220 | file.DeleteFile(); |
| | 221 | } |
| | 222 | }}} |