I always thought that when using the routine Files.File.Register that the name parameter should exclude the extension. Writing the code to find the last '.' and stripping off the rest is a bit tedious, and this morning I left it out. To my surprise there was no problem.
So:
1 - Should the name include / exclude the extension?
2 - What happens if the extension is not consistent with the type parameter?
3 - Should the Docu be improved to clarify these answers?
Robert
Minor documentation improvements
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: Minor documentation improvements
My guess is that this behavior was different for Windows and MacOS.
Therefore it has not been specified.
Now we have Windows only and we could probably specify it.
May be with a hint that this applies to Files.stdDir (i.e. Windows file system interface),
since Files.dir is exchangeable in principle.
The precise behavior seems to come from HostFiles.Append.
Properties to consider are: type is empty, filename (without any path) contains dot;
or something like that.
Note that when you use File->Save As... there are additional rules applied
before calling Register (I guess this is done inside the Windows file dialog).
- Josef
Therefore it has not been specified.
Now we have Windows only and we could probably specify it.
May be with a hint that this applies to Files.stdDir (i.e. Windows file system interface),
since Files.dir is exchangeable in principle.
The precise behavior seems to come from HostFiles.Append.
Properties to consider are: type is empty, filename (without any path) contains dot;
or something like that.
Note that when you use File->Save As... there are additional rules applied
before calling Register (I guess this is done inside the Windows file dialog).
- Josef