> For the complete documentation index, see [llms.txt](https://academy.shade.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.shade.inc/shade-academy/shade-academy-zh/shadefs/pinning-files-offline.md).

# 将文件固定为离线

## 固定的工作原理

已固定的文件会与其他缓存文件一起存储在你的缓存目录中，但它们不受缓存大小限制或驱逐规则的约束。当你固定内容时，ShadeFS 会创建一个完整的本地副本，直到你明确取消固定为止。 **这意味着无论你配置的缓存大小是多少，你都可以固定本地存储能够容纳的任意数量的内容。**

{% embed url="<https://youtu.be/apDcYPUC7tw?si=LB3hSQr8zL2Ow_Md>" %}

<figure><img src="https://450378260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2F68km9NfoiJhtY8v2Z75F%2FPin%20files%20to%20Cache.gif?alt=media&#x26;token=61a05333-4ac7-4f98-a852-171bb391e929" alt=""><figcaption></figcaption></figure>

## 离线工作

即使在离线状态下，已固定的文件也仍然完全可访问。你在离线期间对已固定文件所做的任何更改都会在系统中标记为“dirty”，表示它们需要与云端同步。这些文件会受到保护，不会被缓存驱逐，直到它们成功同步，以确保你重新联网时不会丢失任何工作。

当重新连接或重启 ShadeFS 时，系统会自动识别任何已更改的文件，并将它们与 Shade 云同步。

## 冲突更改

如果在你离线期间其他人更改了同一个文件，ShadeFS 会保留两个版本。他们的版本保留原始名称，而你的版本会与其一起保存，并带有 `-冲突-` 并在名称末尾添加一个数字，例如 `edit.prproj-conflict-2847193021`。不会覆盖任何内容，因此你可以比较这两个版本并保留你想要的那个。

如果你和其他人都创建了同名文件，情况也是如此。

## 固定层级

ShadeFS 使用层级系统来处理固定。当处理嵌套文件夹时：

* 固定父文件夹会自动包含其所有内容
* 如果外层文件夹和内层文件夹都已固定，取消固定内层文件夹不会产生任何影响，因为外层文件夹的固定状态优先
* 你可以在未固定的父文件夹中有选择地固定特定文件或文件夹

## 灵活使用

ShadeFS 固定功能的一个主要优势是其灵活性：

* 你无需先挂载驱动器即可固定文件
* 你可以固定的内容没有限制（超过可用存储空间除外）
* 固定状态会在系统重启和重新连接后保持不变
* 即使离线，你也可以继续处理已固定的文件
* 当文件正在固定时，你仍然可以继续工作。你通过已挂载驱动器打开的文件总是会先于已固定文件下载，因此固定会在你主动播放媒体时减慢速度，而不会拖慢你的播放。

## 管理已固定内容

{% hint style="info" %}
已固定文件会将你固定的所有文件完整地离线保存，绕过你设置的缓存限制，这些限制用于临时和标准存储。这意味着你可以固定 **的内容可能超过你缓存驱动器上剩余的可用空间，具体取决于你要固定的内容。**
{% endhint %}

要固定文件或文件夹：

1. 打开 Shade 应用
2. 导航到所需内容
3. 右键单击并选择“固定到缓存”

要取消固定内容：

1. 右键单击已固定项目
2. 选择“从缓存取消固定”

取消固定文件也会移除其本地副本。你也可以从 **设置 > ShadeFS > 缓存管理**.

查看所有已固定文件或文件夹，你可以导航到 **已固定项目** 页面，你可以在驱动器级别或工作区级别访问它。

### 从 Finder 固定（macOS）

在 macOS 上，你也可以直接从 Finder 固定和取消固定。右键单击已挂载 Shade 驱动器上的文件或文件夹，然后选择 **固定到缓存** 或 **从缓存取消固定**。如果你选择了多个项目，该选项会显示将要固定或取消固定的项目数量。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://academy.shade.inc/shade-academy/shade-academy-zh/shadefs/pinning-files-offline.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
