files-community / files-community/Files

Bug: The first file and directory names to exceed the 260-character `MAX_PATH` limit appear truncated.

Open
#17,133 14 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
45.4k
Forks
2.9k
Avg merge
19h 7m
Merged PRs (30d)
62

Description

### Description

https://github.com/user-attachments/assets/005ef77e-c937-45ea-9dd6-edb4144962f8

As the aforementioned demonstrates, accessing a path whose length exceeds `MAX_PATH` (ascertained by attempting to access [`\\wsl.localhost\fedoraremix\mnt\rjlb_data\@{'Name'='Entities'}#.dir\@{'Status'='Commenced'; 'Name'='In Use'}#.dir\@{'Person'='Beedell'; 'Identifier'='S21AIB'}#.dir\@{'Name'='Entity-Specific'}#.dir\@{'Person'='Roke'; 'Identifier'='S1EV2L'}#.dir\@{'Name'='Technical'}#.dir`](file://///wsl.localhost/fedoraremix/mnt/rjlb_data/@%7B'Name'='Entities'%7D%23.dir/@%7B'Status'='Commenced'%3b%20'Name'='In%20Use'%7D%23.dir/@%7B'Person'='Beedell'%3b%20'Identifier'='S21AIB'%7D%23.dir/@%7B'Name'='Entity-Specific'%7D%23.dir/@%7B'Person'='Roke'%3b%20'Identifier'='S1EV2L'%7D%23.dir/@%7B'Name'='Technical'%7D%23.dir) via a BTRFS `wsl --mount`) causes a network resource access error:

![Image](https://github.com/user-attachments/assets/1b4ce9ac-6f00-4bea-889b-ce1618382951)

### Steps To Reproduce

1. Create the undermentioned structure:

1. ~~~sh
#!/usr/bin/env sh
sudo lsblk -f
~~~

1.

~~~RS
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
sdb
sdc [SWAP]
sdd 954.8G 0% /mnt/wslg/distro
/
sde
├─sde1
├─sde2
├─sde3
└─sde4 1.4T 24% /mnt/test
sdf
└─sdf1 184.3G 90% /mnt/rjlb_data
~~~

To do so, create a BTRFS-formatted filesystem on a blank storage device, then mount it:

1. ~~~pwsh
#!/usr/bin/env pwsh
#Requires -PSEdition Core
If ($IsWindows) {
sudo wsl --mount \\.\PHYSICALDRIVE1 --bare
}
~~~

1. ~~~sh
#!/usr/bin/env sh
sudo lsblk -f
# Utilise the output to confirm that the *device* has been mounted into `wsl`, then set its path as `$dev_id`, and define a mount point at `$path`.
sudo mount -t btrfs /dev/$dev_id /mnt/$path
~~~

1. When mounted, create the hideous path aforementioned. If you attempt to access it via the Files GUI, it should display the aforementioned error modal.

This probably isn't a minimal reproduction list, because I've yet to narrow the cause.

### Files Version

3.9.9.0

### Windows Version

10.0.26120

### User ID

353b71b8-86f9-4fe0-ac0e-e1da114b9349

### Log File

[`debug.log`](https://github.com/user-attachments/files/20256697/debug.log)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.