Jump to content
Posted 28 July 2012 - 03:21 PM
Posted 28 July 2012 - 04:42 PM
Edited by edd, 28 July 2012 - 04:46 PM.
Posted 28 July 2012 - 05:41 PM
Posted 28 July 2012 - 05:56 PM
I just want to add to this, because OS X is a little weird in this regard. In the Finder, you can give a filename with a '/' character in it, but it get's converted to a ':' character. So if you name a file "a/z" it will show as "a/z" in the Finder, but from the Terminal it will show as "a:z".
Here, all characters except '/' are allowed in path segments, including funny things like '\n'. Stay away from using ':' in paths if possible as that can sometimes confuse the Finder due to Mac OS 9 baggage. Backslash, '\\', really does mean a backslash character. It's not a separator under any circumstances.
Posted 28 July 2012 - 08:35 PM
Edited by Firestryke31, 28 July 2012 - 08:37 PM.
Posted 29 July 2012 - 11:47 AM
Wow, thanks for that write-up; it contains alot of the kind of information I'm trying to understand. Some of it is really surprising, like the "D:abc.txt" and "\abc.txt" - both those meanings are new to me, and seem likely to accidentally occur in day-to-day programming.
...too much stuff to go through in one sitting....
That's a great idea, and I would do that... but for one thing: Modding
All of that complexity is why a lot of games go with a single data file approach. That is you create a single file, containing all game data, which works like (and often is) a zip file. There are cross platform libraries like http://icculus.org/physfs/ to handle reading zip files.
Static game data (world, dialog, etc...) and dynamic data (config files, game saves), but all modifiable by the end-user.
What are you planning on using the long paths for? Is it something that could be better served using a file format (world info) or an archive (static game info)? Or do you just want to make sure you can write saved games to your game's data folder?
Edited by Servant of the Lord, 29 July 2012 - 11:47 AM.
Posted 29 July 2012 - 02:55 PM
My recent understanding is that you can't use ( or ), or even commas, on Linux machines (right?), so now I have a problem! Better to catch it now, then after I ship for Windows.
Posted 29 July 2012 - 04:00 PM
Posted 29 July 2012 - 04:14 PM
Posted 29 July 2012 - 06:08 PM
I'm trying to go with the lowest common denominator of rules, but I don't know what the rules are.
Out of interest, if you're aiming for cross-platform why not go for the most conservative approach? Obviously you need to figure out what the most conservative approach is, but it seems safest. Do you perhaps have automated tools that output assets with a particular filename structure that would make that cumbersome?
Well, I need users to being able to alter things if they want, and IDs for filenames would make it hard for users to understand what is referencing what.
Would it perhaps make sense to have a function/method which creates the filenames based on enum values, asset ids, etc? That would at least mean you'd have the code side covered, you could easily change the filename format if you discovered issues. Of course renaming and moving the files would be a pest, but that could be handled with a tool.
I'm pretty sure that I have seen/used both ( ) and , in linux paths.
Posted 29 July 2012 - 07:00 PM
Posted 29 July 2012 - 07:15 PM
Edited by Servant of the Lord, 29 July 2012 - 07:29 PM.