<?
/***********************************************************************************/
/*/ /*/
/*/ program: file system class(fsc) /*/
/*/ php programer :吴双(james wu) /*/
/*/ email: wu-shuang@163.net /*/
/*/ homepage: http://www.dev-php.com /*/
/*/ date: 2002-01-24 /*/
/*/ /*/
/***********************************************************************************/
class fsc{
/**************************************************************************/
// 函数名: getfilesource
// 功能: 得到指定文件的内容
// 参数: $file 目标文件
/**************************************************************************/
function getfilesource($file){
if($fp=fopen($file,'r')){
$filesource=fread($fp,filesize($file));
fclose($fp);
return $filesource;
}
else
return false;
}
/**************************************************************************/
// 函数名: writefile
// 功能: 创建新文件,并写入内容,如果指定文件名已存在,那将直接覆盖
// 参数: $file -- 新文件名
// $source 文件内容
/**************************************************************************/
function writefile($file,$source){
if($fp=fopen($file,'w')){
$filesource=fwrite($fp,$source);
fclose($fp);
| 对此文章发表了评论 |
