You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FullFileExtension of report. is "." (and of archive.tar. is ".tar.") while FileExtension is "", though the docs say they follow the same rules #542
FileExtension treats a trailing dot as no extension (lastDotIndex == path.Length - 1 returns ""). WeakStringWithoutExtension and RemoveExtension() follow the same rule.
FullFileExtension returns everything from the first dot after the name's first character, and has no trailing-dot check. Its <remarks> says it "follows the same rules as FileExtension".
Failure scenario
Observed on Linux, net10.0:
Path
FileExtension
FullFileExtension
RemoveExtension()
/home/u/report.
''
'.'
/home/u/report
/home/u/archive.tar.
''
'.tar.'
/home/u/archive.tar
/home/u/.bashrc.
''
'.'
/home/u/.bashrc
/home/u/archive.tar.gz
.gz
.tar.gz
(correct)
A bare "." is reported as a file extension, and .tar. keeps its trailing dot. Code that dispatches on FullFileExtension therefore gets a different answer from code that uses FileExtension for the same file. Expected: report. and .bashrc. have no full extension, and archive.tar. gives .tar, consistent with how FileExtension treats the trailing dot.
Suggested fix / acceptance criteria
FullFileExtension ignores a trailing dot, the same way FileExtension and WeakStringWithoutExtension do.
Tests pin the three trailing-dot rows above, for both absolute and relative file paths.
Priority: Low. This is an edge case: file names that end in a dot are rare on Linux and stripped on Windows. But the two properties disagree with each other and with the <remarks>, which is a correctness gap.
Area / suggested assignment:Semantics.Paths, SemanticFilePath.FullFileExtension
Next step: Add the trailing-dot guard to FullFileExtension, so that archive.tar. gives .tar, and pin the three rows from the table in tests for absolute and relative paths.
Activity
matt-edmondson commentedon Nov 7, 2026
Triage
<remarks>, which is a correctness gap.Semantics.Paths,SemanticFilePath.FullFileExtension/, as a file path #325/Treat a dotfile as having no extension in RemoveExtension and ChangeExtension [patch] #426 (dotfiles inRemoveExtension). This is the remaining trailing-dot case forFullFileExtension.DirectoryPathoperators, not extensions.FullFileExtension, so thatarchive.tar.gives.tar, and pin the three rows from the table in tests for absolute and relative paths.Generated by Claude Code