Changeset 36445 in project
- Timestamp:
- 08/26/18 10:55:08 (6 months ago)
- Location:
- wiki
- Files:
-
- 9 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/eggref/5/magic
r36351 r36445 7 7 === Description 8 8 9 libmagic bindings.9 Bindings to the magic file recognition library. 10 10 11 11 Two modules are included, {{(magic)}} and {{(magic libmagic)}}: 12 12 13 * {{(magic)}} is a high-level wrapper providing a single procedure 14 called {{identify}}. 15 * {{(magic libmagic)}} is a one-to-one binding to {{libmagic.h}}, used 16 exactly like the C library. 13 * {{(magic)}} is a high-level wrapper providing a single procedure called {{identify}}. 14 * {{(magic libmagic)}} is a one-to-one binding to {{libmagic.h}}, used exactly like the C library. 17 15 18 16 The following documentation applies to the {{(magic)}} module. … … 24 22 One procedure is provided, {{identify}}, that tries to do what you mean. 25 23 26 Whenever libmagic returns an error, an exception of type {{(exn magic)}} 27 is raised. 24 Whenever libmagic returns an error, an exception of type {{(exn magic)}} is raised. 28 25 29 Note that the {{magic}} module loads libmagic's magic numbers database 30 as soon as it's {{require}}d (a.k.a. {{use}}d). If you're not OK with 31 this, use the low-level module. 26 Note that the {{magic}} module loads libmagic's magic numbers database as soon as it's loaded. If you're not OK with this, use the low-level module. 32 27 33 28 <procedure>(identify [object [flags]]) => string</procedure> 34 29 35 {{identify}} returns a textual description of the file indicated by 36 {{object}}, or the contents of {{(current-input-port)}} if no {{object}} 37 is specified. 30 {{identify}} returns a textual description of the file indicated by {{object}}, or the contents of {{(current-input-port)}} if no {{object}} is specified. 38 31 39 If {{object}} is given, it may be any of the following object types, 40 with {{identify}} returning a description of: 32 If {{object}} is given, it may be any of the following object types, with {{identify}} returning a description of: 41 33 42 34 * {{blob}}: the contents of the blob. 43 35 * {{string}}: the contents of the file indicated by the given filename. 44 36 * {{integer}}: the contents of that file descriptor. 45 * {{input-port}}: the contents of the given port. This port must be 46 backed by a file descriptor; if not, an error of type {{(exn type)}} 47 will be raised. 37 * {{input-port}}: the contents of the given port. This port must be backed by a file descriptor; if not, an error of type {{(exn type)}} will be raised. 48 38 49 If {{flags}} is given, it must be a symbol or list of symbols indicating 50 the type of description to return. These correspond to the {{MAGIC_*}} 51 constants in {{libmagic.h}}, and can be any combination of the following 52 (though not all combinations make sense): 39 If {{flags}} is given, it must be a symbol or list of symbols indicating the type of description to return. These correspond to the {{MAGIC_*}} constants in {{libmagic.h}}, and can be any combination of the following (though not all combinations make sense): 53 40 54 41 * {{apple}} -
wiki/users/evan-hanson
r33401 r36445 3 3 == Evan Hanson 4 4 5 I'm a Schemer currently living in NZ, and one of CHICKEN's 6 [[/maintainers|maintainers]]. 5 I'm a Schemer currently living in NZ, and one of CHICKEN's [[/maintainers|maintainers]]. 7 6 8 You can usually contact me as 9 [[ircs://irc.freenode.net:6697/evhan,isnick|evhan]] in 10 [[ircs://irc.freenode.net:6697/chicken|#chicken]]. 7 You can usually contact me as [[ircs://irc.freenode.net:6697/evhan,isnick|evhan]] in [[ircs://irc.freenode.net:6697/chicken|#chicken]]. 11 8 12 9 * [[http://foldling.org/|Homepage]] … … 23 20 * [[/eggref/4/git|git]] 24 21 * [[/eggref/4/glfw|glfw]] 22 * [[/eggref/4/isaac|isaac]] 25 23 * [[/eggref/4/magic|magic]] 26 24 * [[/eggref/4/module-declarations|module-declarations]] … … 33 31 * [[/eggref/4/type-extensions|type-extensions]] 34 32 * [[/eggref/4/with-current-directory|with-current-directory]] 35 * [[/eggref/4/wodehaus|wodehaus]]36 33 * [[/eggref/4/yahoo-finance|yahoo-finance]] 37 34 … … 54 51 === Other 55 52 56 I maintain a 57 [[http://bitbucket.org/evhan/heroku-buildpack-chicken|buildpack]] for 58 running CHICKEN applications on Heroku. 53 I maintain a [[http://bitbucket.org/evhan/heroku-buildpack-chicken|buildpack]] for running CHICKEN applications on Heroku.
Note: See TracChangeset
for help on using the changeset viewer.