\FileSystem

Provides properties and methods for working with drives, files, and directories in VisualBasic.

Summary

Methods
Properties
Constants
BaseName()
NormalizePath()
OpenWriter()
WriteAllText()
ReadAllText()
IteratesAllLines()
RenameFile()
GetDirectories()
GetParentPath()
CreateDirectory()
GetFiles()
XCopy()
TempFileName()
Lanudry()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

BaseName()

BaseName(  $path) 

Get file name from a given without extensions.

Parameters

$path

NormalizePath()

NormalizePath(  $path,   $windowsStyle = false) 

Parameters

$path
$windowsStyle

OpenWriter()

OpenWriter(  $file,   $appendNewLine = FALSE,   $append = FALSE) : callable

函数返回一个函数指针,使用``!wq``指令来关闭文件

Parameters

$file
$appendNewLine
$append

Returns

callable —

只接受一个文件数据的输入参数

WriteAllText()

WriteAllText(string  $file, string  $text, boolean  $append = FALSE) : void

Writes text to a file.

这个函数会自动创建文件夹

Parameters

string $file

文件路径

string $text

文件内容字符串

boolean $append

是否在原有的文件基础之上进行数据的追加?默认不是,会覆盖掉源文件

ReadAllText()

ReadAllText(string  $file,   $default = null) : string

Returns the contents of a text file as a String.

如果目标文件不存在的话,函数会直接返回空值

Parameters

string $file

Name and path of the file to read.

$default

Returns

string

IteratesAllLines()

IteratesAllLines(  $path) 

这是一个迭代器函数,只能够配合foreach一起使用

Parameters

$path

RenameFile()

RenameFile(  $file,   $newName) 

Renames a file.

Parameters

$file
$newName

GetDirectories()

GetDirectories(  $directory) 

Parameters

$directory

GetParentPath()

GetParentPath(  $path) 

Parameters

$path

CreateDirectory()

CreateDirectory(  $directory) 

Creates a directory.

Parameters

$directory

GetFiles()

GetFiles(  $directory,   $suffix = "*") 

Returns a read-only collection of strings representing the names of files within a directory.

Parameters

$directory
$suffix

XCopy()

XCopy(string  $source, string  $dest, integer  $permissions = 493) : boolean

Copy a file, or recursively copy a folder and its contents

Parameters

string $source

Source path

string $dest

Destination path

integer $permissions

New folder creation permissions

Returns

boolean —

Returns true on success, false on failure

TempFileName()

TempFileName(  $prefix = "tmp") : string

Get temp file path.

Parameters

$prefix

Returns

string —

The temp file path.

Lanudry()

Lanudry(integer  $bytes) : string

对bytes数值进行格式自动优化显示

Parameters

integer $bytes

Returns

string —

经过自动格式优化过后的大小显示字符串