What I’m thinking of doing is creating my own filetype extensions not using the standard windows 3 character file extension format, (if it still exists?)
filename.header (contains file header info)
filename.original (original file locked)
filename.edited (original file edited)
filename.txt (import standard ascii text file)
In actual fact all filetypes will be ascii, readable in any text editor.
So for example, using the Xojo FileTypes filter, I can code it so the user can only open/save *.edited files. Which will also be within a strict folder structure under my main application. The only filetypes that can be imported from anywhere will be *.txt files, which can then only be saved and auto renamed *.edited under the edited files folder.
I’ve tested the file extensions by setting up a FileType with various test extensions and it appears to work fine. Also, this question is a pre-cursor to questions I’ll be asking in the future regarding File IO operations and the Special Folder.
Anyway, apart from the strict folder structure, my main question here is are there any potential issues using non-standard extensions that I’m not aware of?
I’m aware that there is some sort of registry for file extensions. It doesn’t seem that the registry is strict, as in registering a domain name where there can only be one, but more of a ‘courtesy’.???
If I consider a JPEG file denoted as *.jpg then it will depend on what program I associate *.jpg files to be opened with - in Windows or MacOS. I think I have PhotoShop being the one - it could be MS Office Picture Manager or My Photo Album, etc… It shouldn’t really matter.
If a user selects my *.edited filetype in the finder/file manager, and if that extension is associated with my program then I guess it should launch and open the file. I’m not sure how to go about what happens with the other filetypes though.
This issue is now the “Main Event” with my software. This is the crucial part for file IO to work as I want.
For the Mac check out UTIs. There are imported and exported UTIs, which I think is a very suboptimal name. The exported UTIs are the file types that you define yourself. The imported ones are for the standard types like jpg so that your app can handle a jpg but it’s not the primary app like for the exported UTIs.
Thanks Axel & Emile. I’ve checked out that list and there aren’t too many extensions shown beyond the basic 3 character format. Therefore it does seem I can create my own extensions without conflict or repercussions.
Thanks Norman. My initial tests and thoughts were that it all works fine. My concern was more about if it was “standard practice” and what issues there could be later on. Being a hobby programmer my Achilles heal will always be whether my ideas conform to the standards - simply because I don’t know them.
My software will only allow the user to open files from a custom list without using the standard OS dialog box. My view is that this makes it simpler for the user to not have to worry - as in a dedicated software and device.
Is this a “VALID” concept or poor programming practice?
As Emile pointed out, It’s my software and I should do what I want with it . . . I think I stretched that a bit far