Forum und email

rpm_is_valid

(PECL rpmreader:0.1-0.3)

rpm_is_valid — Tests a filename for validity as an RPM file

Descrierea

bool rpm_is_valid ( string $filename )

rpm_is_valid() will test an RPM file for validity as an RPM file. This is not the same as rpm_open() as it only checks the file for validity but does not return a file pointer to be used by further functions.

Parametri

filename

The filename of the RPM file you wish to check for validity.

Valorile întroarse

Întoarce valoarea TRUE în cazul succesului sau FALSE în cazul eşecului.

Exemple

Example#1 rpm_is_valid() example

<?php

$file 
"/path/to/file.rpm";

if (
rpm_is_valid($file)) {
    echo 
"File is recognized as an RPM file.<br>\n";
}
else {
    echo 
"File is not recognized as an RPM file.<br>\n";
}

?>