> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# filesystem

> filesystem — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/filesystem/mod.rs#L1-L108)&#x20;

KiFS (Kinetica File System) API module.This module provides a high-level API for interacting with Kinetica’s distributed file system (KiFS). It supports file uploads, downloads, directory management, and file operations with support for both single-file and multi-part transfers.

## Features

<ul>
  <li>**File Upload**: Upload single files or multiple files with glob pattern support</li>
  <li>**File Download**: Download single files or entire directories</li>
  <li>**Directory Management**: Create, delete, and list KiFS directories</li>
  <li>**Progress Callbacks**: Optional listeners for tracking upload/download progress</li>
  <li>**Multi-part Transfers**: Automatic handling of large files using chunked transfers</li>
  <li>**Glob Pattern Support**: Use patterns like `*.csv` or `data/**/*.json` for batch operations</li>
</ul>

## Example

```rust theme={null}
use gpudb_api::{Kinetica, KineticaOptions};
use gpudb_api::filesystem::{KifsFileHandler, KifsFileHandlerOptions, UploadOptions};
use std::sync::Arc;

let kinetica = Arc::new(
    Kinetica::new(vec!["http://localhost:9191".to_string()], KineticaOptions::new()).await?
);

// Create a file handler
let handler = KifsFileHandler::new(kinetica, None);

// Create a directory
handler.create_directory("my_directory", true).await?;

// Upload a file
handler.upload("/path/to/file.csv", "my_directory", None, None).await?;

// Upload multiple files with glob pattern
handler.upload("/data/*.csv", "my_directory", None, None).await?;

// Download a file
handler.download("my_directory/file.csv", "/local/path", None, None).await?;

// List files in a directory
let files = handler.show_files(vec!["my_directory".to_string()]).await?;
for file in files {
    println!("File: {} ({} bytes)", file.file_name, file.file_size);
}

// Delete a file
handler.delete_files(vec!["my_directory/file.csv".to_string()], true).await?;

// Delete a directory
handler.delete_directory("my_directory", true, true).await?;
```

## Modules

[ingest\_<wbr />option](https://docs.kinetica.com/content/api/rust/filesystem/ingest_option/index.md)Names of the ingest options.[table\_<wbr />creation\_<wbr />option](https://docs.kinetica.com/content/api/rust/filesystem/table_creation_option/index.md)Names of the table creation options.

## Structs

[Download<wbr />Options](https://docs.kinetica.com/content/api/rust/filesystem/struct.DownloadOptions.md)Options for file download operations.[FnDownload<wbr />Listener](https://docs.kinetica.com/content/api/rust/filesystem/struct.FnDownloadListener.md)A simple download listener that wraps callback functions.[FnUpload<wbr />Listener](https://docs.kinetica.com/content/api/rust/filesystem/struct.FnUploadListener.md)A simple upload listener that wraps callback functions.[Ingest<wbr />Options](https://docs.kinetica.com/content/api/rust/filesystem/struct.IngestOptions.md)Options for ingesting files: the options of `/insert/records/fromfiles`.[Ingest<wbr />Result](https://docs.kinetica.com/content/api/rust/filesystem/struct.IngestResult.md)What an ingest did.[Kifs<wbr />Directory<wbr />Info](https://docs.kinetica.com/content/api/rust/filesystem/struct.KifsDirectoryInfo.md)Information about a KiFS directory.[Kifs<wbr />File<wbr />Handler](https://docs.kinetica.com/content/api/rust/filesystem/struct.KifsFileHandler.md)Main class for interacting with the Kinetica File System (KiFS).[Kifs<wbr />File<wbr />Handler<wbr />Options](https://docs.kinetica.com/content/api/rust/filesystem/struct.KifsFileHandlerOptions.md)Options for the KiFS file handler.[Kifs<wbr />File<wbr />Info](https://docs.kinetica.com/content/api/rust/filesystem/struct.KifsFileInfo.md)Information about a KiFS file.[Multi<wbr />Part<wbr />Download<wbr />Info](https://docs.kinetica.com/content/api/rust/filesystem/struct.MultiPartDownloadInfo.md)Information about a part of a multi-part download.[Multi<wbr />Part<wbr />Upload<wbr />Info](https://docs.kinetica.com/content/api/rust/filesystem/struct.MultiPartUploadInfo.md)Information about a multi-part upload operation.[NoOp<wbr />Download<wbr />Listener](https://docs.kinetica.com/content/api/rust/filesystem/struct.NoOpDownloadListener.md)A no-op download listener that ignores all callbacks. Useful for operations where progress tracking is not needed.[NoOp<wbr />Upload<wbr />Listener](https://docs.kinetica.com/content/api/rust/filesystem/struct.NoOpUploadListener.md)A no-op upload listener that ignores all callbacks. Useful for operations where progress tracking is not needed.[Operation<wbr />Result](https://docs.kinetica.com/content/api/rust/filesystem/struct.OperationResult.md)Result of an upload or download operation.[Table<wbr />Creation<wbr />Options](https://docs.kinetica.com/content/api/rust/filesystem/struct.TableCreationOptions.md)Options for the table an ingest creates: the create table options of `/insert/records/fromfiles`.[Upload<wbr />Options](https://docs.kinetica.com/content/api/rust/filesystem/struct.UploadOptions.md)Options for file upload operations.

## Enums

[Error<wbr />Handling<wbr />Mode](https://docs.kinetica.com/content/api/rust/filesystem/enum.ErrorHandlingMode.md)How the server handles a record it cannot insert.[File<wbr />Type](https://docs.kinetica.com/content/api/rust/filesystem/enum.FileType.md)The type of the files ingested.[Multi<wbr />Part<wbr />Operation](https://docs.kinetica.com/content/api/rust/filesystem/enum.MultiPartOperation.md)Multi-part operation stages for upload/download. Where there is no stage, an `Option<MultiPartOperation>` is `None`.[OpMode](https://docs.kinetica.com/content/api/rust/filesystem/enum.OpMode.md)Indicates whether an operation is an upload or download.[Partition<wbr />Type](https://docs.kinetica.com/content/api/rust/filesystem/enum.PartitionType.md)How a table created for the ingest is partitioned.[Type<wbr />Inference<wbr />Mode](https://docs.kinetica.com/content/api/rust/filesystem/enum.TypeInferenceMode.md)How the server infers the types of the columns of a table it creates.

## Constants

`pub const KIFS_PATH_PREFIX: &str = "kifs://";`

Prefix to use when referencing KiFS files; e.g., for purposes of file ingest.

`pub const KIFS_PATH_SEPARATOR: &str = "/";`

Separator character between a KiFS directory and KiFS file name. This can also be used within a file name to create a virtual directory within a path.

`pub const REMOTE_USER_HOME_DIR_PREFIX: &str = "~";`

Alias for a user’s home directory.

## Traits

[File<wbr />Download<wbr />Listener](https://docs.kinetica.com/content/api/rust/filesystem/trait.FileDownloadListener.md)Listener trait for file download progress callbacks.[File<wbr />Upload<wbr />Listener](https://docs.kinetica.com/content/api/rust/filesystem/trait.FileUploadListener.md)Listener trait for file upload progress callbacks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.