.


:




:

































 

 

 

 


7. . ..




<?php

//

$dir = opendir(".");

//

while (($file = readdir($dir))!== false)

{

if($file!= "." && $file!= "..") echo "$file<br>";

}

//

closedir($dir);?>

Web- , . is_file() is_dir(), :

bool is_file(string filename) bool is_dir(string filename)

. is_file() true , , false . is_dir(), .

( )

file_exists (), , . , true, false.

, 7.

 

7.

<?php

$file_count =0; //

$dir_count =0; //

$arr = scandir("."); //

foreach($arr as $file)

{

// , //

//

if($file == "." || $file == "..") continue;

// ,

if(is_dir($file)) ++$dir_count;

// , "

if(is_file($file)) ++$file_count;)

//

echo " $dir_count ,<br>";

echo " $file_count ";?>

Web- Web- Windows, UNIX- , Windows .

UNIX :

□ ;

□ , ;

□ .

. 4, 2, 1. , 6 (4 + 2) , 7 (4 + 2 + 1) .

: 644. "" , , 755.

 

chmod(), :

bool chmod(string filename, int mode)

filename, mode , .

()

0, , 0755, 755 .

8.

8.

<?php

// .

// 0

chmod("index.php", 0644);?>

, , - . 9.





:


: 2016-12-04; !; : 227 |


:

:

: , , , , .
==> ...

1656 - | 1502 -


© 2015-2024 lektsii.org - -

: 0.012 .