phpDocumentor utility
[ class tree: utility ] [ index: utility ] [ all elements ]

Class: WindFile

Source Location: /utility/WindFile.php

Class WindFile

Class Overview

文件工具类

Located in /utility/WindFile.php [line 12]



		
				Author(s):
		
		
		
Information Tags:
Version:  $Id: WindFile.php 3298 2012-01-06 12:48:26Z yishuo $
Copyright:  ©2003-2103 phpwind.com
License:  http://www.windframework.com

Methods

[ Top ]
Constant Summary
APPEND_WRITE   以追加写入方式打开文件,具有较强的平台移植性
APPEND_WRITEREAD   以追加读写入方式打开文件,具有较强的平台移植性
READ   以读的方式打开文件,具有较强的平台移植性
READWRITE   以读写的方式打开文件,具有较强的平台移植性
WRITE   以写的方式打开文件,具有较强的平台移植性
WRITEREAD   以读写的方式打开文件,具有较强的平台移植性

[ Top ]
Method Summary
static boolean   del()   删除文件
static array   getInfo()   取得文件信息
static string   getSuffix()   取得文件后缀
static boolean   isFile()  
static string   read()   读取文件
static void   savePhpData()   保存文件
static int   write()   写文件

[ Top ]
Methods
static method del  [line 56]

  static boolean del( string $filename  )

删除文件

Parameters:
string   $filename:  文件名称

API Tags:
Access:  public


[ Top ]
static method getInfo  [line 136]

  static array getInfo( string $fileName  )

取得文件信息

Parameters:
string   $fileName:  文件名字

API Tags:
Return:  文件信息
Access:  public


[ Top ]
static method getSuffix  [line 146]

  static string getSuffix( string $filename  )

取得文件后缀

Parameters:
string   $filename:  文件名称

API Tags:
Access:  public


[ Top ]
static method isFile  [line 126]

  static boolean isFile( string $fileName  )

Parameters:
string   $fileName: 

API Tags:
Access:  public


[ Top ]
static method read  [line 113]

  static string read( string $fileName, [string $method = self::READ]  )

读取文件

Parameters:
string   $fileName:  文件绝对路径
string   $method:  读取模式默认模式为rb

API Tags:
Return:  从文件中读取的数据
Access:  public


[ Top ]
static method savePhpData  [line 69]

  static void savePhpData( string $fileName, mixed $data, [boolean $isBuildReturn = true], [string $method = self::READWRITE], [boolean $ifLock = true]  )

保存文件

Parameters:
string   $fileName:  保存的文件名
mixed   $data:  保存的数据
boolean   $isBuildReturn:  是否组装保存的数据是return $params的格式,如果没有则以变量声明的方式保存,默认为true则以return的方式保存
string   $method:  打开文件方式,默认为rb+的形式
boolean   $ifLock:  是否对文件加锁,默认为true即加锁

API Tags:
Access:  public


[ Top ]
static method write  [line 95]

  static int write( string $fileName, string $data, [string $method = self::READWRITE], [bool $ifLock = true], [bool $ifCheckPath = true], [bool $ifChmod = true]  )

写文件

Parameters:
string   $fileName:  文件绝对路径
string   $data:  数据
string   $method:  读写模式,默认模式为rb+
bool   $ifLock:  是否锁文件,默认为true即加锁
bool   $ifCheckPath:  是否检查文件名中的“..”,默认为true即检查
bool   $ifChmod:  是否将文件属性改为可读写,默认为true

API Tags:
Return:  返回写入的字节数
Access:  public


[ Top ]
Constants
APPEND_WRITE = 'ab' [line 42]

以追加写入方式打开文件,具有较强的平台移植性


[ Top ]
APPEND_WRITEREAD = 'ab+' [line 48]

以追加读写入方式打开文件,具有较强的平台移植性


[ Top ]
READ = 'rb' [line 18]

以读的方式打开文件,具有较强的平台移植性


[ Top ]
READWRITE = 'rb+' [line 24]

以读写的方式打开文件,具有较强的平台移植性


[ Top ]
WRITE = 'wb' [line 30]

以写的方式打开文件,具有较强的平台移植性


[ Top ]
WRITEREAD = 'wb+' [line 36]

以读写的方式打开文件,具有较强的平台移植性


[ Top ]

Documentation generated on Fri, 30 Mar 2012 11:43:32 +0800 by phpDocumentor 1.4.4