On Mon, 20 Jan 2014, Sven Schreiber wrote:
Am 19.01.2014 15:15, schrieb Allin Cottrell:
>
> 2. Binary data files: I've now implemented Jack's suggestion in
>
http://lists.wfu.edu/pipermail/gretl-devel/2014-January/004872.html
>
> So here's how things stand: the --binary option to "store" is gone;
> instead, to save data as binary, use the new ".gdtb" filename
> extension, as in
>
> store foo.gdtb <optional-series-list>
>
> This results in creation of a zip file containing data.xml
> (metadata) and data.bin (binary component).
Is that literally "data" in the name always? The alternative would be
"foo" I guess -- although the user doesn't normally get to see these
names anyway, right?
Yes, it's literally "data". These internal files are basically supposed to
be invisible to users, though of course it's possible to unzip the gtdb
file and get at the components. (Similar zipped archives such as ods files
have generically named contents.)
> Under the menu "/File/Open data" we have both
"User file", which
> leads to a file selector equipped with a long list of file types
> (both native and "import" formats) and an "import" item which
lists
> the supported import formats. I'd like to get rid of the "import"
> item since it really just repeats in a different form what's
> available under "User file". And similarly for the "Append data"
> menu: I'd like to switch to a single file selector with a drop-down
> list of filters.
Yes I like that, although...
>
> There's one possible downside of this, but I doubt that it's a real
> issue. That is, suppose one has a misnamed file (e.g. a plain text
> file with ".xls" extension). In principle you could handle this by
> selecting "text/CSV" from the current import menu (hence forcing the
> interpretation of the file) and then using the "All files" filter in
> the dialog, or manually typing the spurious filename. The option of
> pre-forcing the interpretation of a file regardless of its name
> would be gone under my suggestion. But how many users have ever done
> this sort of thing? (Besides, this is a work-around for a problem
> that has an obvious and simple correct solution: rename the file in
> question. If you're smart enough to figure out that the "import"
> menu allows you to work around broken filenames, you're smart enough
> to fix the file!)
Well, being a veteran Mac user (not much OS X use, though) I remember
Apple's philosophy that metadata of a file is more than just the
extension, thus it was stored differently (does the "resource fork" of a
file still exist on Mac?), and thus typically Mac files did not have an
extension. Actually the same has always been true on Unix, no?
(/var/log/messages anyone?)
So I think the problem is not really misnamed files, but the ones that
deliberately do not have an extension. I wouldn't consider these broken,
and thus IMHO gretl would need to deal with that. Perhaps a greyed-out
drop-down list of file formats that only becomes activated when the *.*
filter is chosen.
It's true that not every filename has an extension, and not every file
whose name lacks an extension is of the same type. Besides "known" system
files such as /var/log/messages on unix, most executables have no
extension on unix-type systems. Moreover, using ".txt" for plain text
files is something of a Microsoftism and it wouldn't be unusual to come
across plain text files on Linux (and maybe Mac) without any extension.
However... I think it's fair to say that all the types of data file that
gretl can import, _apart_ from plain text, have a specific expected
extension, such that the name could be considered broken without it (e.g.
an Excel file without ".xls" or ".xlsx", a Stata file without
".dta").
We should support an unfiltered "All files" mode for the data-open file
selection dialog, but I think we're OK in assuming that this implies plain
text.
Allin