Skip to content

Windows: support of long paths - #495

Merged
JeromeMartinez merged 4 commits into
MediaArea:mainfrom
JeromeMartinez:Windows_LongPaths
Oct 13, 2026
Merged

JeromeMartinez merged 4 commits into
MediaArea:mainfrom
JeromeMartinez:Windows_LongPaths

Conversation

@JeromeMartinez

Copy link
Copy Markdown
Member

No description provided.

Files were opened with the ANSI API (CreateFileA, fopen, _access_s,
_mkdir, FindFirstFileExA...), limited to MAX_PATH (260 characters) for
the full path, so e.g. the reversibility data of a file in a directory
of 200 characters could not be created.
File names are now converted to the wide API, with the \\?\ prefix on
the full path (from GetFullPathNameW, so relative paths, '/' and ".."
are handled as before) if it is too long for the Win32 API, without
the need of the LongPathsEnabled system setting. Short paths are used
as before. This is used for reading and writing files, creating
directories, listing directories and removing or renaming temporary
files.
FFmpeg 6.0 and later support long paths too (4.2 and 4.4 do not).
The x86 linker does not support EH continuation metadata (LNK1246 with
/guard:ehcont), so it is enabled only for x64.
File sizes from the directory listing are computed with uintmax_t, the
shift of the 32-bit size_t by 32 was undefined behavior (C4293) in
32-bit builds.
A DPX file in a directory of 230 characters is encoded with the FFmpeg
command displayed by rawcooked then decoded, its reversibility data and
its decoded file have more than 260 characters (MAX_PATH on Windows).
A sequence in a directory of more than 300 characters is encoded with
--check then decoded in a new directory of more than 300 characters.
The current directory stays shorter than MAX_PATH, else Git Bash does not
start native programs. On Windows, FFmpeg needs to support long paths
too (FFmpeg 6.0 and later).
Windows is checked by GitHub Actions (MSVC2026 build and all the tests
of make check in Git Bash). The AppVeyor configuration built the removed
MSVC2019 project and ran only a part of the tests (last update in 2020).
@JeromeMartinez
JeromeMartinez merged commit 3f6bebd into MediaArea:main Oct 13, 2026
3 checks passed
@JeromeMartinez
JeromeMartinez deleted the Windows_LongPaths branch October 13, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant