Home
last modified time | relevance | path

Searched refs:file (Results 126 – 150 of 2043) sorted by relevance

12345678910>>...82

/PHP-7.3/ext/standard/tests/file/
H A Dfread_basic.phpt13 // include the file.inc for common functions for test
14 include ("file.inc");
33 test fread with file opened in "r" and "rb" mode only
53 echo "Error: failed to fopen() file: $filename!";
71 /* read file by giving size more than its size */
83 // reading 1000 bytes within the file max size
94 var_dump(fclose($file_handle)); // now close the file
97 // delete the file created
98 delete_file($filename); // delete file with name
109 Reading 1024 bytes from file, expecting 1024 bytes ... OK
[all …]
H A Dcopy_variation13.phpt6 Description: Makes a copy of the file source to dest.
10 /* Test copy(): Trying to copy dir to an existing file */
14 $file = $file_path."/copy_variation13_dir.tmp";
15 fclose(fopen($file, "w"));
19 echo "*** Testing copy() in copying dir to file ***\n";
20 var_dump( copy($dir, $file) );
22 var_dump( file_exists($file) );
28 var_dump( is_file($file) );
29 var_dump( is_dir($file) );
31 var_dump( filesize($file) );
[all …]
H A D007_variation14.phpt9 Description: Opens file or URL.
14 Description: Closes an open file pointer
17 /* Test fopen() and fclose(): Opening the file in "a+t" mode,
18 checking for the file creation, write & read operations,
19 checking for the file pointer position,
23 require($file_path."/file.inc");
26 $file = $file_path."/007_variation14.tmp";
30 $file_handle = fopen($file, "a+t"); //opening the file "a+t" mode
40 unlink($file); //Deleting the file
41 fclose( fopen($file, "a+t") ); //Opening the non-existing file in "a+t" mode, which will be created
[all …]
H A D007_variation21.phpt9 Description: Opens file or URL.
14 Description: Closes an open file pointer
17 /* Test fopen() and fclose(): Opening the file in "ab" mode,
18 checking for the file creation, write & read operations,
19 checking for the file pointer position,
23 require($file_path."/file.inc");
26 $file = $file_path."/007_variation21.tmp";
30 $file_handle = fopen($file, "ab"); //opening the file "ab" mode
41 unlink($file); //Deleting the file
42 fclose( fopen($file, "ab") ); //Opening the non-existing file in "ab" mode, which will be created
[all …]
H A D007_variation22.phpt9 Description: Opens file or URL.
14 Description: Closes an open file pointer
17 /* Test fopen() and fclose(): Opening the file in "a+b" mode,
18 checking for the file creation, write & read operations,
19 checking for the file pointer position,
23 require($file_path."/file.inc");
26 $file = $file_path."/007_variation22.tmp";
30 $file_handle = fopen($file, "a+b"); //opening the file "a+b" mode
40 unlink($file); //Deleting the file
41 fclose( fopen($file, "a+b") ); //Opening the non-existing file in "a+b" mode, which will be created
[all …]
H A D007_variation5.phpt9 Description: Opens file or URL.
14 Description: Closes an open file pointer
17 /* Test fopen() and fclose(): Opening the file in "a" mode,
18 checking for the file creation, write & read operations,
19 checking for the file pointer position,
23 require($file_path."/file.inc");
26 $file = $file_path."/007_variation5.tmp";
30 $file_handle = fopen($file, "a"); //opening the file "a" mode
41 unlink($file); //Deleting the file
42 fclose( fopen($file, "a") ); //Opening the non-existing file in "a" mode, which will be created
[all …]
H A D007_variation6.phpt9 Description: Opens file or URL.
14 Description: Closes an open file pointer
17 /* Test fopen() and fclose(): Opening the file in "a+" mode,
18 checking for the file creation, write & read operations,
19 checking for the file pointer position,
23 require($file_path."/file.inc");
26 $file = $file_path."/007_variation6.tmp";
30 $file_handle = fopen($file, "a+"); //opening the file "a+" mode
40 unlink($file); //Deleting the file
41 fclose( fopen($file, "a+") ); //Opening the non-existing file in "a+" mode, which will be created
[all …]
H A Dfgetcsv_variation11.phpt48 echo "Error: failed to create file $filename!\n";
62 // else rewind the file pointer to beginning of the file
67 // rewind the file pointer to bof
80 // check the file pointer position and if eof
84 // close the file
86 //delete file
96 -- Testing fgetcsv() with file opened using r mode --
106 -- Testing fgetcsv() with file opened using rb mode --
116 -- Testing fgetcsv() with file opened using rt mode --
126 -- Testing fgetcsv() with file opened using r+ mode --
[all …]
H A Dfwrite_variation1-win32-mb.phpt23 include ("file.inc");
62 // move the file pointer to end of the file and try fwrite()
85 -- Opening file in r --
97 -- Opening file in rb --
109 -- Opening file in rt --
123 -- Opening file in r --
135 -- Opening file in rb --
147 -- Opening file in rt --
161 -- Opening file in r --
173 -- Opening file in rb --
[all …]
H A Dfwrite_variation1-win32.phpt23 include ("file.inc");
62 // move the file pointer to end of the file and try fwrite()
85 -- Opening file in r --
97 -- Opening file in rb --
109 -- Opening file in rt --
123 -- Opening file in r --
135 -- Opening file in rb --
147 -- Opening file in rt --
161 -- Opening file in r --
173 -- Opening file in rb --
[all …]
H A Dfwrite_variation1.phpt23 include ("file.inc");
61 // move the file pointer to end of the file and try fwrite()
83 -- Opening file in r --
95 -- Opening file in rb --
107 -- Opening file in rt --
121 -- Opening file in r --
133 -- Opening file in rb --
145 -- Opening file in rt --
159 -- Opening file in r --
171 -- Opening file in rb --
[all …]
H A Dfgetcsv_variation15.phpt43 echo "Error: failed to create file $filename!\n";
56 // else rewind the file pointer to beginning of the file
61 // rewind the file pointer to bof
70 // check the file pointer position and if eof
74 // close the file
76 //delete file
86 -- Testing fgetcsv() with file opened using r mode --
96 -- Testing fgetcsv() with file opened using rb mode --
106 -- Testing fgetcsv() with file opened using rt mode --
116 -- Testing fgetcsv() with file opened using r+ mode --
[all …]
H A Dfgetcsv_variation16.phpt45 echo "Error: failed to create file $filename!\n";
58 // else rewind the file pointer to beginning of the file
63 // rewind the file pointer to bof
74 // check the file pointer position and if eof
78 // close the file
80 //delete file
90 -- Testing fgetcsv() with file opened using r mode --
100 -- Testing fgetcsv() with file opened using rb mode --
110 -- Testing fgetcsv() with file opened using rt mode --
120 -- Testing fgetcsv() with file opened using r+ mode --
[all …]
H A Dfgetss_variation5-win32.phpt57 // rewind the file pointer to beginning of the file
76 // close the file
79 // delete the file
93 -- Reading when file pointer points to EOF --
108 -- Reading when file pointer points to EOF --
123 -- Reading when file pointer points to EOF --
138 -- Reading when file pointer points to EOF --
153 -- Reading when file pointer points to EOF --
168 -- Reading when file pointer points to EOF --
183 -- Reading when file pointer points to EOF --
[all …]
H A Dfgetss_variation5.phpt54 // rewind the file pointer to beginning of the file
73 // close the file
76 // delete the file
90 -- Reading when file pointer points to EOF --
105 -- Reading when file pointer points to EOF --
120 -- Reading when file pointer points to EOF --
135 -- Reading when file pointer points to EOF --
150 -- Reading when file pointer points to EOF --
165 -- Reading when file pointer points to EOF --
180 -- Reading when file pointer points to EOF --
[all …]
H A Dfile_variation4.phpt2 Test file() function : third parameter variation
5 /* Prototype : array file(string filename [, int flags[, resource context]])
6 * Description: Read entire file into an array
7 * Source code: ext/standard/file.c
11 echo "*** Testing file() : usage variation ***\n";
55 // create a file stream resource
111 // file stream resource
112 'file stream resource' => $file_stream_resource,
119 var_dump( file($filename, $flags, $value) );
129 *** Testing file() : usage variation ***
[all …]
H A Dfilesize_variation4-win32.phpt2 Test filesize() function: usage variations - file mode & holes in file
17 require($file_path."/file.inc");
20 …** Testing filesize() with data written using different file modes and by creating holes in file *…
40 echo "-- opening the file in 'a' mode, adding data and checking the file --\n";
47 echo "-- opening the file in 'at' mode, adding data and checking the file --\n";
73 echo "-- with empty file --\n";
89 *** Testing filesize() with data written using different file modes and by creating holes in file *…
96 -- opening the file in 'a' mode, adding data and checking the file --
98 -- opening the file in 'at' mode, adding data and checking the file --
105 -- opening the existing file in write mode --
[all …]
H A D007_variation13-win32.phpt14 Description: Opens file or URL.
19 Description: Closes an open file pointer
22 /* Test fopen() and fclose(): Opening the file in "at" mode,
23 checking for the file creation, write & read operations,
24 checking for the file pointer position,
28 require($file_path."/file.inc");
31 $file = $file_path."/007_variation13.tmp";
35 $file_handle = fopen($file, "at"); //opening the file "at" mode
46 unlink($file); //Deleting the file
47 fclose( fopen($file, "at") ); //Opening the non-existing file in "at" mode, which will be created
[all …]
H A D007_variation13.phpt14 Description: Opens file or URL.
19 Description: Closes an open file pointer
22 /* Test fopen() and fclose(): Opening the file in "at" mode,
23 checking for the file creation, write & read operations,
24 checking for the file pointer position,
28 require($file_path."/file.inc");
31 $file = $file_path."/007_variation13.tmp";
35 $file_handle = fopen($file, "at"); //opening the file "at" mode
46 unlink($file); //Deleting the file
47 fclose( fopen($file, "at") ); //Opening the non-existing file in "at" mode, which will be created
[all …]
H A D007_variation8.phpt9 Description: Opens file or URL.
14 Description: Closes an open file pointer
17 /* Test fopen() and fclose(): Opening the file in "x+" mode,
18 checking for the file creation, write & read operations,
19 checking for the file pointer position,
20 checking for the warning msg when trying to open an existing file in "x+" mode,
25 $file = $file_path."/007_variation8.tmp";
28 $file_handle = fopen($file, "x+"); //opening the non-existing file in "x+" mode, file will be crea…
31 var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the…
37 var_dump( fclose($file_handle) ); //Check for close operation on the file handle
[all …]
H A Dbug45985.phpt2 Bug #35740 (touch() opened file raises a warning)
5 $file = __DIR__ . '/' . '__tmp_35740.dat';
6 file_put_contents($file, 'test');
7 $f = fopen($file, 'r');
8 touch($file);
10 @unlink($file);
H A Dfnmatch_basic.phpt15 echo "*** Testing fnmatch() with file ***\n";
16 $file = basename(__FILE__);
18 var_dump( fnmatch("*.php", $file) );
19 var_dump( fnmatch("*.p*p", $file) );
20 var_dump( fnmatch("*.p*", $file) );
21 var_dump( fnmatch("*", $file) );
22 var_dump( fnmatch("**", $file) );
23 var_dump( fnmatch("*.phpt", $file) );
25 echo "*** Testing fnmatch() with other than file ***\n";
35 *** Testing fnmatch() with file ***
[all …]
H A Dfgetcsv_variation21.phpt34 echo "Error: failed to create file $filename!\n";
41 // else rewind the file pointer to beginning of the file
46 // rewind the file pointer to bof
57 // check the file pointer position and if eof
61 // close the file
63 //delete file
72 -- Testing fgetcsv() with file opened using r mode --
80 -- Testing fgetcsv() with file opened using rb mode --
88 -- Testing fgetcsv() with file opened using rt mode --
96 -- Testing fgetcsv() with file opened using r+ mode --
[all …]
H A Dfilesize_variation4.phpt2 Test filesize() function: usage variations - file mode & holes in file
16 /* Testing filesize() with data written using different file modes and by creating holes in file */
21 …** Testing filesize() with data written using different file modes and by creating holes in file *…
42 echo "-- opening the file in 'a' mode, adding data and checking the file --\n";
49 echo "-- opening the file in 'at' mode, adding data and checking the file --\n";
75 echo "-- with empty file --\n";
91 *** Testing filesize() with data written using different file modes and by creating holes in file *…
98 -- opening the file in 'a' mode, adding data and checking the file --
100 -- opening the file in 'at' mode, adding data and checking the file --
107 -- opening the existing file in write mode --
[all …]
H A Dfgetcsv_variation10.phpt2 Test fgetcsv() : usage variations - file pointer pointing to EOF
10 /* Testing fgetcsv() by reading from a file when the file pointer is pointing to end of file */
47 echo "Error: failed to create file $filename!\n";
61 // else rewind the file pointer to beginning of the file
68 // set the file pointer to EOF
73 // now file pointer should point to end of the file, try reading again
76 // check the file pointer position and if eof
80 // check the file pointer position and if eof
84 // close the file
86 //delete file
[all …]

Completed in 77 milliseconds

12345678910>>...82