Show / Hide Table of Contents

Class VFS

Represents a TileDB VFS (Virtual File System) object.

Inheritance
object
VFS
Implements
IDisposable
Namespace: TileDB.CSharp
Assembly: TileDB.CSharp.dll
Syntax
public sealed class VFS : IDisposable

Constructors

| Edit this page View Source

VFS()

Creates a VFS.

Declaration
public VFS()
| Edit this page View Source

VFS(Context)

Creates a VFS associated with the given Context.

Declaration
public VFS(Context ctx)
Parameters
Type Name Description
Context ctx

The context to associate the VFS with.

| Edit this page View Source

VFS(Context?, Config?)

Creates a VFS associated with the given Context.

Declaration
public VFS(Context? ctx = null, Config? config = null)
Parameters
Type Name Description
Context ctx

The context to associate the VFS with. Defaults to GetDefault()

Config config

The VFS' Config. Defaults to ctx's config.

Methods

| Edit this page View Source

Config()

Gets the Config() associated with this VFS.

Declaration
public Config Config()
Returns
Type Description
Config
| Edit this page View Source

CopyDir(string, string)

Copies a directory.

Declaration
public void CopyDir(string old_uri, string new_uri)
Parameters
Type Name Description
string old_uri

The source URI of the directory.

string new_uri

The destination URI of the directory. Will be overwritten if it exists.

| Edit this page View Source

CopyFile(string, string)

Copies a file.

Declaration
public void CopyFile(string old_uri, string new_uri)
Parameters
Type Name Description
string old_uri

The source URI of the file.

string new_uri

The destination URI of the file. Will be overwritten if it exists.

| Edit this page View Source

CreateBucket(string)

Creates an object-store bucket.

Declaration
public void CreateBucket(string uri)
Parameters
Type Name Description
string uri

The URI of the bucket to be created.

| Edit this page View Source

CreateDir(string)

Creates a directory.

Declaration
public void CreateDir(string uri)
Parameters
Type Name Description
string uri

The directory's URI.

| Edit this page View Source

DirSize(string)

Gets the size of a directory.

Declaration
public ulong DirSize(string uri)
Parameters
Type Name Description
string uri

The directory's URI.

Returns
Type Description
ulong
| Edit this page View Source

Dispose()

Disposes this VFS.

Declaration
public void Dispose()
| Edit this page View Source

EmptyBucket(string)

Deletes the contents of an object-store bucket.

Declaration
public void EmptyBucket(string uri)
Parameters
Type Name Description
string uri

The URI of the bucket to be emptied.

| Edit this page View Source

FileSize(string)

Gets the size of a file.

Declaration
public ulong FileSize(string uri)
Parameters
Type Name Description
string uri

The file's URI.

Returns
Type Description
ulong
| Edit this page View Source

GetChildren(string)

Lists the top-level children of a directory.

Declaration
public List<string> GetChildren(string uri)
Parameters
Type Name Description
string uri

The URI of the directory.

Returns
Type Description
List<string>

A List<T> containing the children of the directory in uri.

Remarks

This function does not visit the children recursively; only the top-level children of uri will be visited.

| Edit this page View Source

GetChildrenRecursive(string)

Lists all files of a directory and its subdirectories recursively.

Declaration
public List<(string Uri, ulong Size)> GetChildrenRecursive(string uri)
Parameters
Type Name Description
string uri

The URI of the directory.

Returns
Type Description
List<(string Uri, ulong Size)>

A List<T> containing the files of the directory in uri and their sizes.

Remarks

This operation is supported only on URIs to local file system, S3, Azure and GCS.

| Edit this page View Source

IsBucket(string)

Checks whether a URI points to a bucket.

Declaration
public bool IsBucket(string uri)
Parameters
Type Name Description
string uri

The URI to check.

Returns
Type Description
bool
| Edit this page View Source

IsDir(string)

Checks whether a URI points to a directory.

Declaration
public bool IsDir(string uri)
Parameters
Type Name Description
string uri

The URI to check.

Returns
Type Description
bool
| Edit this page View Source

IsEmptyBucket(string)

Checks whether a bucket is empty or not.

Declaration
public bool IsEmptyBucket(string uri)
Parameters
Type Name Description
string uri

The URI of the bucket to be checked.

Returns
Type Description
bool
| Edit this page View Source

IsFile(string)

Checks whether a URI points to a file.

Declaration
public bool IsFile(string uri)
Parameters
Type Name Description
string uri

The URI to check.

Returns
Type Description
bool
| Edit this page View Source

MoveDir(string, string)

Renames a directory.

Declaration
public void MoveDir(string old_uri, string new_uri)
Parameters
Type Name Description
string old_uri

The source URI of the directory.

string new_uri

The destination URI of the directory. Will be overwritten if it exists.

| Edit this page View Source

MoveFile(string, string)

Renames a file.

Declaration
public void MoveFile(string old_uri, string new_uri)
Parameters
Type Name Description
string old_uri

The source URI of the file.

string new_uri

The destination URI of the file. Will be overwritten if it exists.

| Edit this page View Source

Open(string, VfsMode)

Opens a file.

Declaration
public VFSFile Open(string uri, VfsMode mode)
Parameters
Type Name Description
string uri

The file's URI.

VfsMode mode

The mode in which the file is opened.

Returns
Type Description
VFSFile

A VFSFile object that can be used to perform operations on the file.

| Edit this page View Source

RemoveBucket(string)

Removes an object-store bucket.

Declaration
public void RemoveBucket(string uri)
Parameters
Type Name Description
string uri

The URI of the bucket to be removed.

| Edit this page View Source

RemoveDir(string)

Removes a directory.

Declaration
public void RemoveDir(string uri)
Parameters
Type Name Description
string uri

The directory's URI.

| Edit this page View Source

RemoveFile(string)

Removes a file.

Declaration
public void RemoveFile(string uri)
Parameters
Type Name Description
string uri

The file's URI.

| Edit this page View Source

Touch(string)

Touches a file, i.e., creates a new empty file.

Declaration
public void Touch(string uri)
Parameters
Type Name Description
string uri

The file's URI.

| Edit this page View Source

VisitChildrenRecursive<T>(string, Func<string, ulong, T, bool>, T)

Visits all files of a directory and its subdirectories recursively.

Declaration
public void VisitChildrenRecursive<T>(string uri, Func<string, ulong, T, bool> callback, T callbackArg)
Parameters
Type Name Description
string uri

The URI of the directory to visit.

Func<string, ulong, T, bool> callback

A callback delegate that will be called with the URI of each file, its size and callbackArg, and returns whether to continue visiting.

T callbackArg

An argument that will be passed to callback.

Type Parameters
Name Description
T

The type of callbackArg.

Remarks

This operation is supported only on URIs to local file system, S3, Azure and GCS.

| Edit this page View Source

VisitChildren<T>(string, Func<string, T, bool>, T)

Visits the top-level children of a directory.

Declaration
public void VisitChildren<T>(string uri, Func<string, T, bool> callback, T callbackArg)
Parameters
Type Name Description
string uri

The URI of the directory to visit.

Func<string, T, bool> callback

A callback delegate that will be called with the URI of each child and callbackArg, and returns whether to continue visiting.

T callbackArg

An argument that will be passed to callback.

Type Parameters
Name Description
T

The type of callbackArg.

Remarks

This function does not visit the children recursively; only the top-level children of uri will be visited.

Implements

IDisposable
  • Edit this page
  • View Source
In this article
Back to top Copyright © 2018-2023 TileDB Inc.