C# Класс Pchp.Library.Streams.FileStreamWrapper

Derived from StreamWrapper, this class provides access to the local filesystem files.
The virtual working directory is handled by the PhpPath class in the Class Library. The absolute path resolution (using the working diretory and the include_path if necessary) and open-basedir check is performed by the PhpStream.ResolvePath method. This wrapper expects the path to be an absolute local filesystem path without the file:// scheme specifier.
Наследование: StreamWrapper
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Listing ( string path, StreamListingOptions options, StreamContext context ) : string[]
MakeDirectory ( string path, int accessMode, StreamMakeDirectoryOptions options, StreamContext context ) : bool
Open ( Context ctx, string &path, string mode, StreamOpenOptions options, StreamContext context ) : PhpStream
RemoveDirectory ( string path, StreamRemoveDirectoryOptions options, StreamContext context ) : bool
Rename ( string fromPath, string toPath, StreamRenameOptions options, StreamContext context ) : bool
Stat ( string path, StreamStatOptions options, StreamContext context, bool streamStat ) : StatStruct
Unlink ( string path, StreamUnlinkOptions options, StreamContext context ) : bool

Приватные методы

Метод Описание
BuildMode ( FileSystemInfo info, FileAttributes attributes, string path ) : FileModeFlags

Creates the UNIX-like file mode depending on the file or directory attributes.

BuildStatStruct ( FileSystemInfo info, FileAttributes attributes, string path ) : StatStruct

Creates a StatStruct from the StatStruct filling the common members (for files and directories) from the given FileSystemInfo class. The size member (numeric index 7) may be filled by the caller for when info is a FileInfo.

According to these outputs (PHP Win32): fstat(somefile.txt): [dev] => 0 [ino] => 0 [mode] => 33206 [nlink] => 1 [uid] => 0 [gid] => 0 [rdev] => 0 [size] => 24 [atime] => 1091131360 [mtime] => 1091051699 [ctime] => 1091051677 [blksize] => -1 [blocks] => -1 stat(somefile.txt): [dev] => 2 [ino] => 0 [mode] => 33206 // 0100666 [nlink] => 1 [uid] => 0 [gid] => 0 [rdev] => 2 [size] => 24 [atime] => 1091129621 [mtime] => 1091051699 [ctime] => 1091051677 [blksize] => -1 [blocks] => -1 stat(somedir): [st_dev] => 2 [st_ino] => 0 [st_mode] => 16895 // 040777 [st_nlink] => 1 [st_uid] => 0 [st_gid] => 0 [st_rdev] => 2 [st_size] => 0 [st_atime] => 1091109319 [st_mtime] => 1091044521 [st_ctime] => 1091044521 [st_blksize] => -1 [st_blocks] => -1

ToStatUnixTimeStamp ( FileSystemInfo info, System.DateTime>.Func utcTimeFunc ) : long

Adjusts UTC time of a file by adding Daylight Saving Time difference. Makes file times working in the same way as in PHP and Windows Explorer.

Описание методов

Listing() публичный Метод

public Listing ( string path, StreamListingOptions options, StreamContext context ) : string[]
path string
options StreamListingOptions
context StreamContext
Результат string[]

MakeDirectory() публичный Метод

public MakeDirectory ( string path, int accessMode, StreamMakeDirectoryOptions options, StreamContext context ) : bool
path string
accessMode int
options StreamMakeDirectoryOptions
context StreamContext
Результат bool

Open() публичный Метод

public Open ( Context ctx, string &path, string mode, StreamOpenOptions options, StreamContext context ) : PhpStream
ctx Pchp.Core.Context
path string
mode string
options StreamOpenOptions
context StreamContext
Результат PhpStream

RemoveDirectory() публичный Метод

public RemoveDirectory ( string path, StreamRemoveDirectoryOptions options, StreamContext context ) : bool
path string
options StreamRemoveDirectoryOptions
context StreamContext
Результат bool

Rename() публичный Метод

public Rename ( string fromPath, string toPath, StreamRenameOptions options, StreamContext context ) : bool
fromPath string
toPath string
options StreamRenameOptions
context StreamContext
Результат bool

Stat() публичный Метод

public Stat ( string path, StreamStatOptions options, StreamContext context, bool streamStat ) : StatStruct
path string
options StreamStatOptions
context StreamContext
streamStat bool
Результат StatStruct

Unlink() публичный Метод

public Unlink ( string path, StreamUnlinkOptions options, StreamContext context ) : bool
path string
options StreamUnlinkOptions
context StreamContext
Результат bool