public function size(string $path): Promise
    {
        if (!@\file_exists($path)) {
            return new Failure(new FilesystemException(
                "Path does not exist"
            ));
        }

        if (!@\is_file($path)) {
            return new Failure(new FilesystemException(
                "Path is not a regular file"
            ));
        }

        if (($size = @\filesize($path)) === false) {
            return new Failure(new FilesystemException(
                \error_get_last()["message"]
            ));
        }

        \clearstatcache(true, $path);
        return new Success($size);
    }
public function size(string $path): Promise
    {
        if (!@\file_exists($path)) {
            return new Failure(new FilesystemException(
                "Path does not exist"
            ));
        }

        if (!@\is_file($path)) {
            return new Failure(new FilesystemException(
                "Path is not a regular file"
            ));
        }

        if (($size = @\filesize($path)) === false) {
            return new Failure(new FilesystemException(
                \error_get_last()["message"]
            ));
        }

        \clearstatcache(true, $path);
        return new Success($size);
    }
public function size ( string $ path ) : Promise { if ( ! @ \ file_exists ( $ path ) ) { return new Failure ( new FilesystemException ( "Path does not exist" ) ) ; } if ( ! @ \ is_file ( $ path ) ) { return new Failure ( new FilesystemException ( "Path is not a regular file" ) ) ; } if ( ( $ size = @ \ filesize ( $ path ) ) === false ) { return new Failure ( new FilesystemException ( \ error_get_last ( ) [ "message" ] ) ) ; } \ clearstatcache ( true , $ path ) ; return new Success ( $ size ) ; }
Retrieve the size in bytes of the file at the specified path.

If the path does not exist or is not a regular file this
function's returned Promise WILL resolve as a failure.

@param string $path An absolute file system path
@return \Amp\Promise<int>
Retrieve the size in bytes of the file at the specified path .