Nathaniel Smith schrieb:
Does it matter? If the file can be displayed reasonably as text, then
you might as well do so; if it can't, then it doesn't matter what the
user says, you can't show it as text. I think a heuristic based on
the file contents should be sufficient here... (this is exactly what
diff(1) does, for that matter).
Now, if monotone could serve me such a heuristic, this would be nice.
Otherwise I could only think of "check every byte in a string and if
there is a zero byte \0, handle it as binary". I don't know if its that
simple, but I doubt it a bit. What could make problems for example is
text encoded in different encodings which use multiple bytes and I could
accidently handle the first byte of one letter as a binary indicator.
This leads me to another interesting question: Has monotone any internal
knowledge of different charsets or is just everything utf-8 and only
decoded into the user's charset if its written to disk? So, do I get
contents in utf-8 out or the charset (whichever it was) the user checked in?
'cat' seems like a fundamental enough operation that we might as well
just provide it as a primitive. ('get_file' is a primitive too, in a
difference sense.) Perhaps get_file_of, by analogy to
get_manifest_of?
Out of curiousity: What is the difference between both primitives beside
that they take different arguments? Wouldn't it be better to have one
command with different input rather than two?
Thomas.
--
ICQ: 85945241 | SIP: 1-747-027-0392 | http://www.thomaskeller.biz
> Guitone, a frontend for monotone: http://guitone.berlios.de
> Music lyrics and more: http://musicmademe.com
_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel