Writing / Post
Windows silently drops trailing periods from folder names, and your naming policy should know
A naming-policy test passed on Linux and failed on Windows because "Sample Bakery, LLC." quietly became "Sample Bakery, LLC". Here is why, and how to write rules that survive it.
Our records policy names business client folders with the legal suffix, as in Sample Bakery, LLC., with a period after the suffix. When I published a clean-room version of the policy engine, the end-to-end test built a sample folder tree and audited it. It passed on Linux. On the Windows CI runner the same test failed: a business folder that should have been compliant was flagged.
What happened
The folder was never created with the period. Windows path normalization trims trailing periods and spaces from the last segment of a path, so a request to create Sample Bakery, LLC. produces Sample Bakery, LLC. No error, no warning. Microsoft's own naming guidance says not to end a file or folder name with a space or a period, because even where the file system can store one, the Windows shell and user interface don't support it.
Prefixing a path with \\?\ skips normalization and can create the name as typed, but then staff get a folder that Explorer and many applications can't open or rename properly. That trades one problem for a worse one.
Why it matters beyond a test
If your file server stores names created from a non-Windows system, or a policy demands a trailing period, people on Windows will either be unable to create compliant names or will end up with names that behave strangely. A compliance scan will then flag work that staff physically couldn't do right.
The fix
- Make the period after a business suffix optional in the policy pattern:
(?:LLC|Inc|Corp|LLP|PLLC)\.?. - Add a note to the written policy so humans and code agree.
- Run the test suite on Windows as well as Linux, because the operating system your users run is part of the specification.
Takeaway
A naming standard is only valid if it can be followed on the platforms people actually use. Test naming rules where the files get created, not just where the code runs.
References: Microsoft, Naming files, paths, and namespaces. The validator with the Windows-safe example policy: naming-policy-validator.