Newer
Older
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(* $Id: rfile.mli,v 1.1 2005/12/31 21:10:46 heinz Exp $
*
* AUS - the advanced update system
* Copyright (C) 2004 Heinz Deinhart
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
(** Remote file access
Provides abstracted access to remote URLs or files via wget
*)
type t
(** Rfile type for one cache path *)
exception Illegal_url of string
(** *)
exception Connection_failure of string
(** URL may be valid, but connection could not be made (e.g. network failure)
*)
exception Url_not_found of string
(** Raised if URL is not found (e.g. 404) *)
exception Cache_failure of string
(** Error accessing cache. Fatal internal error, should not happen *)
val make: string -> t
(** [make path] create Rfile type that is bound to cache dir [path] *)
val open_in_channel: t -> string -> in_channel
(** [open_in_channel t url] access [url] (or its cached content) and return
an input channel for it. Url can be interpreted as an absolute file
name, if it starts with an '/'. Other supported URLs start with
"file", "http" or "ftp".
@raise [Illegal_url] if url format is not detected/supported
@raise [Connection_failure] if url can be temporarly not reached
@raise [Url_not_found] if url is permanently non existant
@raise [Cache_failure] if an internal fatal error in the cache system occurs
*)