Home
last modified time | relevance | path

Searched refs:file (Results 201 – 225 of 2089) sorted by relevance

12345678910>>...84

/PHP-8.1/ext/standard/tests/file/
H A Dfgetc_variation3.phpt6 Description: Gets character from file pointer
15 include ("file.inc");
17 echo "*** Testing fgetc() with file opened in write only mode ***\n";
26 echo "Error: failed to open file $filename!\n";
32 // rewind the file pointer to beginning of the file
37 // read from file
39 var_dump( ftell($file_handle) ); // ensure that file pointer position is not changed
40 var_dump( feof($file_handle) ); // check if end of file pointer is set
42 // close the file
45 // delete the file
[all …]
H A Dfile_put_contents.phpt10 $file = __DIR__."/file_put_contents.txt";
15 var_dump(file_put_contents($file, $context));
19 var_dump(file_put_contents($file, new stdClass));
20 var_dump(file_put_contents($file, new foo));
21 $fp = fopen($file, "r");
23 var_dump(file_put_contents($file, "string", 0, $fp));
28 @unlink($file);
H A Dunlink_variation1.phpt2 Test unlink() function : usage variations - unlinking file in a directory
13 /* Delete file having default permission but its dir having readonly permission
14 Delete file having readonly permission but dir having default permission
25 echo "\n*** Testing unlink() on file inside a directory ***\n";
28 // create temp file inside $dirname
37 var_dump( file_exists($filename) ); // confirm file is deleted
47 // create the temp file
51 // remove write permission from file
53 // now try deleting temp file inside $dirname
63 *** Testing unlink() on file inside a directory ***
[all …]
H A D007_variation10.phpt6 /* Test fopen() and fclose(): Opening the file in "r+t" mode,
7 checking for the file creation, write & read operations,
8 checking for the file pointer position,
12 require($file_path."/file.inc");
15 $file = $file_path."/007_variation10.tmp";
19 $file_handle = fopen($file, "r+t"); //opening the file in "r+t" mode
22 var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the…
24 …ell($file_handle) ); //File pointer position after read operation, expected at the end of the file
26 …ll($file_handle) ); //File pointer position after write operation, expected at the end of the file
27 var_dump( fclose($file_handle) ); //Check for close operation on the file handle
H A D007_variation18.phpt6 /* Test fopen() and fclose(): Opening the file in "r+b" mode,
7 checking for the file creation, write & read operations,
8 checking for the file pointer position,
12 require($file_path."/file.inc");
15 $file = $file_path."/007_variation18.tmp";
19 $file_handle = fopen($file, "r+b"); //opening the file in "r+b" mode
22 var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the…
24 …ell($file_handle) ); //File pointer position after read operation, expected at the end of the file
26 …ll($file_handle) ); //File pointer position after write operation, expected at the end of the file
27 var_dump( fclose($file_handle) ); //Check for close operation on the file handle
H A D007_variation2.phpt6 /* Test fopen() and fclose(): Opening the file in "r+" mode,
7 checking for the file creation, write & read operations,
8 checking for the file pointer position,
12 require($file_path."/file.inc");
15 $file = $file_path."/007_variation2.tmp";
19 $file_handle = fopen($file, "r+"); //opening the file in "r+" mode
22 var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the…
24 …ell($file_handle) ); //File pointer position after read operation, expected at the end of the file
26 …ll($file_handle) ); //File pointer position after write operation, expected at the end of the file
27 var_dump( fclose($file_handle) ); //Check for close operation on the file handle
H A Dstream_001.phpt6 var_dump(stream_wrapper_unregister('file'));
7 var_dump(fopen("file://".__FILE__, "r"));
8 var_dump(stream_wrapper_restore('file'));
9 var_dump(fopen("file://".__FILE__, "r"));
16 Warning: fopen(): Unable to find the wrapper "file" - did you forget to enable it when you configur…
18 Warning: fopen(): file:// wrapper is disabled in the server configuration in %s on line %d
20 Warning: fopen(file://%s): Failed to open stream: no suitable wrapper could be found in %s on line …
H A Duserwrapper.phpt6 function unlink($file) {
7 print "Unlinking file: $file\n";
23 /* By printing out a notice that we are actively stating the file
26 print "Stating file: $path\n";
36 unlink('test://example.com/path/to/file');
42 print_r(stat('test://example.com/path/to/file'));
43 echo "Filesize = " . filesize('test://example.com/path/to/file') . "\n";
44 echo "filemtime = " . filemtime('test://example.com/path/to/file') . "\n";
47 Unlinking file: test://example.com/path/to/file
51 Stating file: test://example.com/path/to/file
H A Dfgets_variation1.phpt11 include ("file.inc");
13 echo "*** Testing fgets() with file opened in write only mode ***\n";
22 echo "Error: failed to open file $filename!\n";
28 // rewind the file pointer to beginning of the file
33 // read from file
35 var_dump( ftell($file_handle) ); // ensure that file pointer position is not changed
36 var_dump( feof($file_handle) ); // check if end of file pointer is set
38 // close the file
41 // delete the file
48 *** Testing fgets() with file opened in write only mode ***
[all …]
H A Dstat_variation3-win32.phpt2 Test stat() functions: usage variations - effects of creating/deleting the dir/file
12 /* test the effects of creating & deleting of subdir/file on the stats of dir/file */
15 require "$file_path/file.inc";
18 /* create temp file and directory */
21 echo "*** Testing stat(): with creating & deleting subdir/file ***\n";
24 echo "-- Testing stat() on dir after subdir and file is created in it --\n";
46 // comparing stats after the deletion of subdir and file
47 echo "-- Testing stat() for comparing stats after the deletion of subdir and file --\n";
63 *** Testing stat(): with creating & deleting subdir/file ***
64 -- Testing stat() on dir after subdir and file is created in it --
[all …]
H A Dfile_basic.phpt2 Test file() function : basic functionality
6 * Description: Reads entire file into an array
8 require(__DIR__ . '/file.inc');
10 echo "*** Testing file() with basic types of files ***\n";
15 print_r( file($file_path."/file_basic1.tmp") );
19 echo "*** Testing for return type of file() function ***\n";
22 $ret_arr = file($file_path."/file_basic1.tmp");
30 *** Testing file() with basic types of files ***
68 *** Testing for return type of file() function ***
H A Dstat_variation5-win32.phpt2 Test stat() functions: usage variations - file opened in read/write mode
12 /* test the stats of file opened in write mode and then same in read mode */
15 require "$file_path/file.inc";
18 $file_handle = fopen("$file_path/stat_variation5.tmp", "w"); // temp file
22 echo "\n*** Testing stat(): on a file with read/write permission ***\n";
25 $file_handle = fopen($filename, "w"); // create file
31 // opening file again in read mode
32 $file_handle = fopen($filename, "r"); // read file
53 *** Testing stat(): on a file with read/write permission ***
H A Dlstat_stat_variation21.phpt12 /* test the effects of truncate() on stats of a file */
15 require "$file_path/file.inc";
18 /* create temp file */
20 $fp = fopen($filename, "w"); // temp file
23 /* ftruncate the current file and check stat() on the file */
25 echo "*** Testing stat() on file by truncating it to given size ***\n";
30 // opening file in r/w mode
51 *** Testing stat() on file by truncating it to given size ***
H A Dfgetcsv_variation17.phpt40 echo "Error: failed to create file $filename!\n";
53 // else rewind the file pointer to beginning of the file
58 // rewind the file pointer to bof
69 // check the file pointer position and if eof
75 // check the file pointer position and if eof
79 // close the file
81 //delete file
91 -- Testing fgetcsv() with file opened using r mode --
107 -- Testing fgetcsv() with file opened using rb mode --
123 -- Testing fgetcsv() with file opened using rt mode --
[all …]
/PHP-8.1/ext/standard/tests/dir/
H A Dclosedir_variation3.phpt2 Test closedir() function : usage variations - close a file pointer
6 * Create a file pointer using fopen() then try to close it using closedir()
11 echo "\n-- Open a file using fopen() --\n";
14 echo "\n-- Try to close the file pointer using closedir() --\n";
20 echo "\n-- Check file pointer: --\n";
30 -- Open a file using fopen() --
33 -- Try to close the file pointer using closedir() --
36 -- Check file pointer: --
H A Dreaddir_variation6-win32-mb.phpt18 // include the file.inc for Function: function create_files()
19 include( __DIR__."/../file/file.inc");
36 while (FALSE !== ($file = readdir($dir_handle1))) {
37 $a[] = $file;
40 foreach ($a as $file) {
41 var_dump($file);
46 while (FALSE !== ($file = readdir())) {
47 $a[] = $file;
50 foreach ($a as $file) {
51 var_dump($file);
/PHP-8.1/ext/simplexml/tests/
H A D022.phpt10 <pres><content><file glob="slide_*.xml"/></content></pres>
19 var_dump($sxe->content->file);
22 foreach($sxe->content->file as $file)
24 var_dump($file);
25 var_dump($file['glob']);
32 ["file"]=>
/PHP-8.1/ext/standard/tests/streams/
H A Dstream_resolve_include_path.phpt8 $include_path_file = $include_path . DIRECTORY_SEPARATOR . 'file';
9 $include_path_nested_file = $include_path_nested . DIRECTORY_SEPARATOR . 'file';
18 var_dump(stream_resolve_include_path('file-does-not-exist'));
21 var_dump(stream_resolve_include_path('file'));
23 var_dump(stream_resolve_include_path('file'));
30 $include_path_file = $include_path . DIRECTORY_SEPARATOR . 'file';
31 $include_path_nested_file = $include_path_nested . DIRECTORY_SEPARATOR . 'file';
H A Dbug70362.phpt7 $file = __DIR__ . '/bug70362.txt';
10 var_dump(copy($data, $file));
11 echo file_get_contents($file);
15 $file = __DIR__ . '/bug70362.txt';
16 @unlink($file);
/PHP-8.1/ext/standard/tests/file/windows_mb_path/
H A Dbug75063_cp1251.phpt2 Bug #75063 Many filesystem-related functions do not work with multibyte file names, cp1251
17 /* This file is in cp1251. */
42 while ((\$file = readdir(\$dh)) !== false) {
43 if ("." == \$file || ".." == \$file) continue;
44 var_dump(\$file);
62 foreach ($obj as $file) {
63 if ("." == $file || ".." == $file) continue;
64 unlink($d0 . DIRECTORY_SEPARATOR . $file);
/PHP-8.1/ext/spl/tests/
H A DSplFileInfo_getExtension_basic.phpt5 $file = md5('SplFileInfo::getExtension');
8 touch($file . $ext);
9 $info = new SplFileInfo($file . $ext);
10 var_dump($info->getExtension(), pathinfo($file . $ext, PATHINFO_EXTENSION));
15 $file = md5('SplFileInfo::getExtension');
18 unlink($file . $ext);
H A Dfileobject_getsize_basic.phpt10 $file = __DIR__ ."/data.txt";
11 file_put_contents($file, "foobar");
13 $s = new SplFileObject( $file );
18 $file = __DIR__ ."/data.txt";
19 unlink($file);
/PHP-8.1/ext/standard/tests/image/
H A Dimage_type_to_mime_type.phpt13 while (($file = readdir($dir)) !== FALSE) {
14 if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") {
15 $files[] = $file;
20 foreach($files as $file) {
21 $result[$file] = getimagesize(__DIR__."/$file");
22 $result[$file] = image_type_to_mime_type($result[$file][2]);
H A Dgetimagesize_246x247.phpt13 while (($file = readdir($dir)) !== FALSE) {
14 if (preg_match('/^246x247\./',$file)) {
15 $files[] = $file;
20 foreach($files as $file) {
21 $result[$file] = getimagesize(__DIR__."/$file");
H A Dgetimagesize_384x385.phpt13 while (($file = readdir($dir)) !== FALSE) {
14 if (preg_match('/^384x385\./',$file)) {
15 $files[] = $file;
20 foreach($files as $file) {
21 $result[$file] = getimagesize(__DIR__."/$file");

Completed in 61 milliseconds

12345678910>>...84