WSL path conversion skills
This skill is used to convert Windows paths to WSL paths, enabling correct access to Windows files in the WSL environment.
Function Description
In the WSL environment, the disk partitions of Windows are mounted under the
/mnt/ directory, for example:
- -
C:\ → INLINECODE2 - INLINECODE3 → INLINECODE4
This skill can automatically recognize the Windows path format and convert it into a path accessible by WSL.
Usage
The skill will automatically handle path conversion. When you provide a path in Windows format, it will be automatically converted to WSL format.
Example
When you mentioned a similar path:
- -
E:\projects\chess_game.png → automatically converted to INLINECODE6 - INLINECODE7 → automatically converted to INLINECODE8
- INLINECODE9 → automatically converted to INLINECODE10
Conversion Rules
- 1. Recognize Windows paths in the format of INLINECODE11
- Convert it to the
/mnt/x/ format - Convert the Windows path separator
\ to the Unix path separator INLINECODE14 - Keep the rest of the path unchanged
Application Scenario
- - Read files from Windows disks
- Access project files in Windows
- Manipulate images or other resources in Windows
- Handle Windows paths in the WSL environment
WSL路径转换技能
该技能用于将Windows路径转换为WSL路径,以便在WSL环境中正确访问Windows文件。
功能说明
在WSL环境中,Windows的磁盘分区会被挂载到/mnt/目录下,例如:
- - C:\ → /mnt/c/
- E:\ → /mnt/e/
该技能能够自动识别Windows路径格式,并将其转换为WSL可访问的路径。
使用方法
该技能会自动处理路径转换。当你提供Windows格式的路径时,会自动转换为WSL格式。
示例
当你提到类似路径时:
- - E:\projects\chessgame.png → 自动转换为 /mnt/e/projects/chessgame.png
- C:\Users\Documents\file.txt → 自动转换为 /mnt/c/Users/Documents/file.txt
- D:\data\images\photo.jpg → 自动转换为 /mnt/d/data/images/photo.jpg
转换规则
- 1. 识别X:\格式的Windows路径
- 将其转换为/mnt/x/格式
- 将Windows路径分隔符\转换为Unix路径分隔符/
- 其余路径部分保持不变
应用场景
- - 读取Windows磁盘中的文件
- 访问Windows中的项目文件
- 操作Windows中的图片或其他资源
- 在WSL环境中处理Windows路径