2 /* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
3 * Description: Open a file or a URL and return a file pointer
4 * Source code: ext/standard/file.c
8 require_once('fopen_include_path.inc');
10 $thisTestDir = basename(__FILE__
, ".php") . ".dir";
14 $newpath = create_include_path();
15 set_include_path($newpath);
17 $newpath = generate_next_path();
18 set_include_path($newpath);
21 teardown_include_path();
22 restore_include_path();
28 $tmpfile = basename(__FILE__
, ".php") . ".tmp";
29 $h = fopen($tmpfile, "w", true);
30 fwrite($h, (binary
)"This is the test file");
34 $h = @fopen
($tmpfile, "r");
36 echo "Not created in working dir\n";
39 echo "created in working dir\n";
44 $h = @fopen
($dir1.'/'.$tmpfile, "r");
46 echo "Not created in dir1\n";
49 echo "created in dir1\n";
51 unlink($dir1.'/'.$tmpfile);