Some (G.getxml (U.cicuri_of_uri bodyuri))
in
let annobj = CicParser.annobj_of_xml cicfilename cicbodyfilename in
+ Unix.unlink cicfilename ;
+ (match cicbodyfilename with None -> () | Some fn -> Unix.unlink fn) ;
annobj,
if U.uri_is_annuri uri then
begin
let annfilename = G.getxml (U.annuri_of_uri uri) in
- Some (CicAnnotationParser.get_annotations annfilename)
+ let res =
+ Some (CicAnnotationParser.get_annotations annfilename)
+ in
+ Unix.unlink annfilename ;
+ res
end
else
None
let cicfilename = G.getxml (U.cicuri_of_uri uri) in
match (U.bodyuri_of_uri uri) with
None ->
- CicParser.annobj_of_xml cicfilename None
+ let annobj = CicParser.annobj_of_xml cicfilename None in
+ Unix.unlink cicfilename ;
+ annobj
| Some bodyuri ->
let cicbodyfilename = G.getxml (U.cicuri_of_uri bodyuri) in
- CicParser.annobj_of_xml cicfilename (Some cicbodyfilename)
+ let annobj =
+ CicParser.annobj_of_xml cicfilename (Some cicbodyfilename)
+ in
+ Unix.unlink cicfilename ;
+ Unix.unlink cicbodyfilename ;
+ annobj
;;
let get_obj uri =
let cicfilename = G.getxml (U.cicuri_of_uri uri) in
match (U.bodyuri_of_uri uri) with
None ->
- CicParser.obj_of_xml cicfilename None
+ let obj = CicParser.obj_of_xml cicfilename None in
+ Unix.unlink cicfilename ;
+ obj
| Some bodyuri ->
let cicbodyfilename = G.getxml (U.cicuri_of_uri bodyuri) in
- CicParser.obj_of_xml cicfilename (Some cicbodyfilename)
+ let obj = CicParser.obj_of_xml cicfilename (Some cicbodyfilename) in
+ Unix.unlink cicfilename ;
+ Unix.unlink cicbodyfilename ;
+ obj
;;