previousFile_Fstab (Previous) (Next) Entriesnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Introduction

Introduction – Introduction to File_Fstab.

Overview

This package allows you to read, manipulate, and write fstab-format files, such as /etc/fstab, /etc/mtab, and /proc/mounts.

Examples

Getting the filesystem type of the root device.

<?php
require_once 'File/Fstab.php';

$fstab =& new File_Fstab();

$root =& $fstab->getEntryForPath('/');
echo 
"Root FS type: " $root->fsType "\n";
?>

Determine if a user may mount the CD-ROM

The user option in your fstab determines whether users may mount a given device or not.

<?php
require_once 'File/Fstab.php';

$fstab =& new File_Fstab();

$cd =& $fstab->getEntryForDevice('/dev/cdrom');
if (
$cd->hasOption('user')) {
    echo 
"Users may mount the CD-ROM\n";
} else {
    echo 
"Users may not mount the CD-ROM\n";
}
?>
previousFile_Fstab (Previous) (Next) Entriesnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.