芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp81/includes/example.php
| // +----------------------------------------------------------------------+ // // $Id: example.php 157959 2004-05-04 19:50:01Z ieure $ require_once 'File/Fstab.php'; // Get an instance for the system's fstab. $sysTab = File_Fstab::singleton('/etc/fstab'); // Get the entry for the root partition. $rootEnt = &$sysTab->getEntryForPath('/'); // See how error handling is set. if ($rootEnt->hasMountOption('errors')) { print "Error handling for / is: ".$rootEnt->mountOptions['errors']."\n"; } else { print "Error handling for / is undefined.\n"; } // Change fstype for / print "Chanking fstype for ".$rootEnt->getDeviceUUIDOrLabel()." (mounted on ".$rootEnt->getMountPoint().") to reiserfs\n"; $rootEnt->fsType = 'reiserfs'; // Create a new entry. print "Adding entry for CD-ROM\n"; $ent = new File_Fstab_Entry; $ent->device = '/dev/cdrom'; $ent->mountPoint = '/cdrom'; $ent->fsType = 'iso9660'; $ent->setMountOption('user'); // Add the entry $sysTab->addEntry(&$ent); // Write to a temp file. print "Saving modified fstab to /tmp/newtab\n"; $res = $sysTab->save('/tmp/newtab'); if (PEAR::isError($res)) { die($res->getMessage()."\n"); } ?>