Create post-HADVAs expect files
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / file / unlink_variation2.php
blob5db0e4faff8fbf675904a80cd52b91dd800771ca
1 <?hh
2 /* Prototype : bool unlink ( string $filename [, resource $context] );
3 Description : Deletes filename
4 */
6 /* Try to unlink file when file handle is still in use */
7 <<__EntryPoint>> function main(): void {
9 echo "*** Testing unlink() on a file which is in use ***\n";
10 // temp file name used here
11 $filename = __SystemLib\hphp_test_tmppath('unlink_variation2.tmp');
13 // create file
14 $fp = fopen($filename, "w");
15 // try unlink() on $filename
16 var_dump( unlink($filename) ); // expected: true on linux
17 var_dump( file_exists($filename) ); // confirm file is deleted
18 // now close file handle
19 fclose($fp);
21 echo "Done\n";