-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: make entity dump filename windows compatible #5145
fix: make entity dump filename windows compatible #5145
Conversation
- windows doesn't allow colons (':') in filenames - so far the filename included the timestamp in format YYYY-MM-DDTHH:MM:SS.MSZ, e.g. 2023-09-28T17:01:31.685172Z-entityDump.json - now colons will be replaced by dashes ('-')
@@ -479,7 +479,7 @@ public String dumpEntities(@CommandParam(value = "componentNames", required = fa | |||
PrefabSerializer prefabSerializer = | |||
new PrefabSerializer(engineEntityManager.getComponentLibrary(), engineEntityManager.getTypeSerializerLibrary()); | |||
WorldDumper worldDumper = new WorldDumper(engineEntityManager, prefabSerializer); | |||
Path outFile = PathManager.getInstance().getHomePath().resolve(Instant.now() + "-entityDump.json"); | |||
Path outFile = PathManager.getInstance().getHomePath().resolve(Instant.now().toString().replaceAll(":", "-") + "-entityDump.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it not be cleaner to use the iso-8601 basic format in general, and not the extended format? see:
https://stackoverflow.com/questions/27725408/alternative-to-colon-in-a-time-format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that using the dumpEntities
commmand does not crash on Windows when testing this pull request.
Windows sometimes makes use of colons in file names for an obscure NTFS feature called file streams. Using that feature usually isn't what you'd want, since it makes the data invisible to most normal programs. There are other special filenames that you should't use but those are just obscure edge-cases that we're unlikely to run into.
Contains
How to test
dumpEntities
Outstanding before merging
Fixes #5144