setDirPermissions() public method

Change the permissions of the directory the file is in.
public setDirPermissions ( mixed $mode ) : File
$mode mixed
return File
Exemplo n.º 1
0
 public function testSetAndGetPermissions()
 {
     $f = new File(__DIR__ . '/../tmp/access.txt');
     if (DIRECTORY_SEPARATOR == '/') {
         $this->assertEquals(777, $f->getPermissions());
         $f->setPermissions(0775);
         $this->assertEquals(775, $f->getPermissions());
         $f->setPermissions(0777);
         $this->assertEquals(777, $f->getPermissions());
         $this->assertEquals(777, $f->getDirPermissions());
         $f->setDirPermissions(0775, true);
         $this->assertEquals(775, $f->getDirPermissions());
         $f->setDirPermissions(0777);
     }
 }