OS differences in paths and naming break cross-platform ports
Aliases: path separators · illegal filename characters · path length limits
What it is
A name the user typed saves on one machine and fails after switching operating systems. Slash versus backslash, drive letters, whether case makes two files, whether colon and question mark are legal, how long a path may be—each system answers differently. Cross-platform path and filename differences make a ported app lose files, split directories wrong, or treat two names as one when the user thought they only changed computers. This is not whether the sandbox grants access, and not someone else editing the file at the same time. It is that the map’s own grammar does not travel.
Why it happens
A path is a string that each system treats as a different grammar. Windows uses backslashes and drive letters, plus a list of reserved names. Unix uses forward slashes and is case-sensitive. macOS is case-insensitive to the outside while preserving case, historically used colon as a separator, and often stores Unicode names in decomposed form. If an app concatenates paths itself, or writes one name onto another system unchanged, the grammar clash explodes inside a user action: report?.md copied from a Mac cannot be created on Windows; C:\Users\... brought back from Windows becomes a single odd name on Unix; two files that differ only in case overwrite each other on a Mac. The error people see is often “could not save,” blamed on permissions or an unknown failure, so they change the wrong thing. The difference hid on the system where it once worked; failure happens on another; cause and effect are cut by the move.
Studying it
Take one set of user-chosen names and nested folders and run save, sync-copy, and open on two operating systems. Include boundary names: reserved names, trailing spaces or dots, over-long paths, non-BMP characters, a pair that differs only in case.
Independent variables: source and destination OS, whether a cloud sync or a ZIP sits in between, whether the app concatenates paths or goes through a system dialog. Dependent variables: save/open success, whether the error says “this name is illegal on the destination,” whether people rename and retry, whether two files become one.
Testing Open/Save on a single system never sees the portability crack. Conflicted names in cloud-sync logs are ready corpus, but split “grammar clash” from “content clash”—the latter is a different entry.
Where it stops holding
An app shipped for one OS can follow local grammar and still ingest foreign names from mail, USB sticks, and repositories. Web apps leave files on a server and only download locally; the clash is pushed to the download step. If a network volume normalizes names on the server, both ends see an already-changed name, and a second normalization in the app renames twice. A professional pipeline that allows only ASCII and forbids spaces crushes the differences, at the cost of people not naming files in their own language.
Applying it
- On save, check illegal characters and reserved names for the current system; the error should name the character or the length that failed and offer a tappable rename, not only “save failed.”
- When syncing or exporting across systems, let system APIs assemble paths; do not concatenate slashes by hand. On a case-insensitive system, refuse silent overwrite of a pair that differs only in case.
- Normalize names that arrive from another system before opening; if they will not open, keep showing the original name so people can see which part the destination rejects.
- Verify: on system A, save names with spaces, non-ASCII, a question mark, and deep nesting; copy to system B and open with the same app. List the failures and whether the error points at naming rules. Create a case-only pair; the insensitive system must block overwrite and say why.
Related
- Within the group: K2.12.1 Desktop apps can read and write the user's filesystem, not only a sandbox · K2.12.3 Apps that touch the filesystem must handle concurrent external edits · K2.12.4 Sandboxing requires apps to declare and request a file-access scope
- Adjacent: K8.07 Consistency versus Platform Convention · S1.03 Character sets, font coverage, and missing glyphs
- Search terms:
path separator·illegal filename·case sensitivity