PYTHON DirectoryIterator::isDot

(2)
Python replacement for PHP's DirectoryIterator::isDot [ edit ]



Do you know a Python replacement for PHP's DirectoryIterator::isDot ? Write it!

PHP DirectoryIterator::isDot

PHP original manual for DirectoryIterator::isDot [ show | php.net ]

DirectoryIterator::isDot

(PHP 5.1.0)

DirectoryIterator::isDotReturns true if current entry is '.' or '..'

Description

bool DirectoryIterator::isDot ( void )

Check whether the current entry is a directory and either . or ...

Parameters

This function has no parameters.

Return Values

TRUE if the entry is . or .., otherwise FALSE

Examples

Example #1 A DirectoryIterator::isDot example

This example will list all files, omitting the . and .. entries.

<?php
$dir 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$dir as $fileinfo) {
    if (!
$fileinfo->isDot()) {
        echo 
'Filename '.$fileinfo->getFilename().PHP_EOL;
    }
}
?>