TYPE DEFA |
OCTAL VALUE | BINARY | REF | VALUES | ||
R E A D |
W R I T E |
E X E C U T E |
||||
INT 0777 |
0777 | 1 | 1 | 1 | OWNER | 7 |
1 | 1 | 1 | GROUP | 7 | ||
1 | 1 | 1 | ALL | 7 | ||
INT 0777 |
0776 | 1 | 1 | 1 | OWNER | 7 |
1 | 1 | 1 | GROUP | 7 | ||
1 | 1 | 0 | ALL | 6 | ||
. . . . . . . . | ||||||
INT 0777 |
0755 | 1 | 1 | 1 | OWNER | 7 |
1 | 0 | 1 | GROUP | 5 | ||
1 | 0 | 1 | ALL | 5 | ||
. . . . . . . . | ||||||
INT 0777 |
0640 | 1 | 1 | 0 | OWNER | 6 |
1 | 0 | 0 | GROUP | 4 | ||
0 | 0 | 0 | ALL | 0 | ||
. . . . . . . . | ||||||
ed48 |
VALUE | MEANING |
FALSE | NESTED DIRECTORY IS ALLOWED |
TRUE | NESTED DIRECTORY IS NOT ALLOWED |
ed48 |
<?php
$dir2make01 = __DIR__ . '/temp';
echo __DIR__ . '/temp' . '<br><br>';
if(!file_exists($dir2make01))
{
@mkdir ($dir2make01);
if(file_exists($dir2make01))
{
echo 'Directory created successfully';
}
else
{
echo 'Directory can not be created';
}
}
else
{
echo 'Directory already exists
and can not be recreated';
}
?>
<?php
$f02 = 'file://' . __DIR__ . '/temp';
echo 'file://' . __DIR__ . '/temp' . '<br><br>';
$opts02 = [ 'http' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $f02 ] ];
$cntxt02 = stream_context_create($opts02);
var_dump($cntxt02);
echo '<br><br>';
?>
<?php
$dir2make03a = __DIR__ . '/temp/t1';
$dir2make03b = __DIR__ . '/temp/t2';
echo __DIR__ . '/temp/t1' . '<br><br>';
echo __DIR__ . '/temp/t2' . '<br><br>';
function fileexists($var)
{
if(!file_exists($var))
{
@mkdir ($var);
echo 'Directory created successfully<br><br>';
}
else
{
echo 'Directory can not be created<br><br>';
}
}
fileexists($dir2make03a);
fileexists($dir2make03b);
?>
<?php
$f04 = 'file://' . __DIR__ . '/temp/t1';
echo 'file://' . __DIR__ . '/temp/t1' . '<br><br>';
$opts04 = [ 'http' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $f04 ] ];
$cntxt04 = stream_context_create($opts04);
var_dump($cntxt04);
echo '<br><br>';
?>
<?php
$dir2make05 = 'file://' . __DIR__ . '/TEST';
// MUST INDICATE A FULL PATH
echo $dir2make05 . '<br><br>';
$opts05 = [ 'http' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $dir2make05 ] ];
$cntxt05 = stream_context_create($opts05);
if(!file_exists($dir2make05))
{
@mkdir ($dir2make05, NULL, FALSE, $cntxt05);
if(file_exists($dir2make05))
{
echo 'Directory created successfully';
}
else
{
echo 'Directory can not be created';
}
}
else
{
echo 'Directory already exists
and can not be recreated';
}
?>
<?php
$dir2make06 = 'file://' . __DIR__ . '/TEST/temp/t2/t2a';
// MUST INDICATE A FULL PATH
echo $dir2make06 . '<br><br>';
$opts06 = [ 'http' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $dir2make06 ] ];
$cntxt06 = stream_context_create($opts06);
if(!file_exists($dir2make06))
{
@mkdir ($dir2make06, NULL, true, $cntxt06);
if(file_exists($dir2make06))
{
echo 'Directory created successfully';
}
else
{
echo 'Directory can not be created';
}
}
else
{
echo 'Directory already exists
and can not be recreated';
}
?>
<?php
$dir2make07 = 'file://' . __DIR__ . '/TEST/temp/t2/t2a';
// MUST INDICATE A FULL PATH
echo "$dir2make07<br><br>";
$opts07 = [ 'http' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'content' => $dir2make07 ] ];
$cntxt07 = stream_context_create($opts07);
if(!file_exists($dir2make07))
{
@mkdir ($dir2make07, NULL, true, $cntxt07);
if(file_exists($dir2make07))
{
echo 'Directory created successfully';
}
else
{
echo 'Directory can not be created';
}
}
else
{
echo 'Directory already exists
and can not be recreated';
}
?>
<?php
$dir2make08 = 'G:/temp/t3';
if(!file_exists($dir2make08))
{
@mkdir ($dir2make08);
if(file_exists($dir2make08))
{
echo 'Directory created successfully';
}
else
{
echo 'Directory can not be created';
}
}
else
{
echo 'Directory already exists
and can not be recreated';
}
?>
<?php
$dir2base09 = __DIR__ . '/';
echo $dir2base09 . '<br><br>';
$dir2mk09 = array( 'data', 'temp', 'user', 'zip');
foreach($dir2mk09 as $v09)
{
if(!file_exists($dir2base09 . $v09))
{
@mkdir ($dir2base09 . $v09);
if(file_exists($dir2base09 . $v09))
{
echo '<br>Directory created successfully';
}
else
{
echo '<br>Directory can not be created';
}
}
else
{
echo '<br>Directory already exists
and can not be recreated';
}
}
?>