summaryrefslogtreecommitdiff
path: root/doc/todo/wishlist__58___annex.largefiles_support_for_mimetypes/comment_4_d06a7c7f1a4fe78af548e2af2fbe8e2b._comment
blob: c379c735f2c38f3254a52ba6df8e6521326e298c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[[!comment format=mdwn
 username="joey"
 subject="""comment 4"""
 date="2016-02-03T19:08:38Z"
 content="""
Update: There are now separate parsers for preferred content and
annex.largefiles expressions, so this could be put in only the
annex.largefiles parser.

I kind of like the idea of letting an external program be run
to test if the file is large. Of course, it would be up to the user to
make the external program fast enough.

The expression could be something like "checkprogram=foo". Since
expressions have simple word-based tokenization, no parameters
would be able to be passed to the program (except the file to check).

For getting mime type, the best way seems to be to use 
<http://hackage.haskell.org/package/magic>. Using `magicOpen [MagicMimeType]`
I got it to probe mime types for files.

Since libmagic won't be available everywhere, it would have to be a build flag,
and if a git-annex not built with support for it is fed an expression with
"magic=", it would have to error out when parsing the expression.

Of course, these options are not mutually exclusive..
"""]]