nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Runtime / Directory

Directory

Full name Microsoft.VisualBasic.FileIO.Directory Assembly Microsoft.VisualBasic.Runtime Members 25

A wrapper object for the processing of relative file path.

00 Remarks

a local filesystem implementation for IFileSystemEnvironment

01 Syntax

Microsoft.VisualBasic.FileIO.Directory

02 Methods

NameOverloadsSummary
.ctor 1 Construct a directory object from the specific Dir path value.
FromLocalFileSystem 1 Create a directory object
GetFullPath 1 Gets the full path of the target file based on the path relative to this directory object.
IsAbsolutePath 1 Determined that the input file path is a absolute path or not?
CopyTo 1 将当前的这个文件夹之中的内容拷贝到target目标文件夹
GetRelativePath 1 get relative of the given file path that relative to current workspace dir
CreateDirectory 1 Creates a directory.
Close 1 Just do nothing for local filesystem
GetSubDirectories 1
ToString 1
Exists 1
Delete 1
OpenFile 1
DeleteFile 1
FileExists 1
FileSize 1
WriteText 1
ReadAllText 1
GetAllFiles 1
FileModifyTime 1
GetFiles 1
EnumerateFiles 1

03 Properties

NameOverloadsSummary
folder 1 当前的这个文件夹对象的文件路径
strict 1
readonly 1

04 Members

method .ctor #
#ctor(String, Boolean)

Construct a directory object from the specific Dir path value.

Parameters
NameTypeDescription
directoryString

Target directory path

method FromLocalFileSystem #
FromLocalFileSystem(String)

Create a directory object

Remarks

this function will create target dir if it is not exists on your filesystem

Parameters
NameTypeDescription
dirString

-

method GetFullPath #
GetFullPath(String)

Gets the full path of the target file based on the path relative to this directory object.

Remarks

the given input file should be inside current directory location, the file path start with prefix / will also be treated as the relative path inside current directory on unix platform, due to the reason of path string combine operation:

 dir/file
Parameters
NameTypeDescription
fileString

The relative path of the target file, and this parameter is also compatible with absolute file path. (相对路径)

method IsAbsolutePath #
IsAbsolutePath(String, Boolean)

Determined that the input file path is a absolute path or not?

Parameters
NameTypeDescription
fileString

-

method CopyTo #
CopyTo(String, IProgress(Of String), Boolean, Boolean)

将当前的这个文件夹之中的内容拷贝到target目标文件夹

Parameters
NameTypeDescription
targetString

The directory path of target folder.

method GetRelativePath #
GetRelativePath(String)

get relative of the given file path that relative to current workspace dir

Parameters
NameTypeDescription
fileString

-

method CreateDirectory #
CreateDirectory(String)

Creates a directory.

Remarks

Exceptions: T:System.ArgumentException: The directory name is malformed. For example, it contains illegal characters or is only white space.

T:System.ArgumentNullException: directory is Nothing or an empty string.

T:System.IO.PathTooLongException: The directory name is too long.

T:System.NotSupportedException: The directory name is only a colon (:).

T:System.IO.IOException: The parent directory of the directory to be created is read-only

T:System.UnauthorizedAccessException: The user does not have permission to create the directory.

Parameters
NameTypeDescription
junctionPointString

Name and location of the directory.

method Close #
Close

Just do nothing for local filesystem

property folder #
folder

当前的这个文件夹对象的文件路径

Remarks

it is the full name via the function FileSystem.GetDirectoryInfo()

property strict #
strict
property readonly #
readonly
method GetSubDirectories #
GetSubDirectories()
method ToString #
ToString()
method Exists #
Exists(String)
method Delete #
Delete(String)
method OpenFile #
OpenFile(String, FileMode, FileAccess)
method DeleteFile #
DeleteFile(String)
method FileExists #
FileExists(String, Boolean)
method FileSize #
FileSize(String)
method WriteText #
WriteText(String, String)
method ReadAllText #
ReadAllText(String)
method GetAllFiles #
GetAllFiles()
method FileModifyTime #
FileModifyTime(String)
method GetFiles #
GetFiles(String, String())
method EnumerateFiles #
EnumerateFiles(String, String())