let realperm = perm land (lnot 0o111) in
match rp with Relpath(rel) ->
let fqp = String.concat "/" [root_dir;rel] in
- Fifowatcher.mkentry fqp abspath realperm;
- Fifowatcher.openentry fqp (abspath,slice_name) realperm
+ let res = Fifowatcher.mkentry fqp abspath realperm slice_name in
+ match res with
+ | Success ->
+ Fifowatcher.openentry fqp (abspath,slice_name) realperm
+ | _ -> ()
(** A new directory was created at the backend, make a corresponding directory
at the frontend. Refer to mkentry for parameters *)
end
else if (s.st_perm <> perm) then
begin
- printf "Removing directory %s\n" fqp;
- flush Pervasives.stdout;
+ fprintf logfd "Removing directory %s\n" fqp;
+ flush logfd;
Unix.rmdir fqp;
Unix.mkdir fqp perm
end
Unix.unlink fqp1;
Unix.unlink fqp2
with _ ->
- printf "Hm. %s disappeared. Looks like slice %s shot itself in the foot\n" fqp1 (this#get_slice_name ());flush Pervasives.stdout
+ fprintf logfd "Hm. %s disappeared. Looks like slice %s shot itself in the foot\n" fqp1 (this#get_slice_name ());flush logfd
method rmdir rp =
match rp with Relpath(rel) ->
try
Unix.rmdir fqp
with _ ->
- printf "Hm. %s disappeared. Looks like slice %s shot itself in the foot\n" fqp (this#get_slice_name ());flush Pervasives.stdout
+ fprintf logfd "Hm. %s disappeared. Looks like slice %s shot itself in the foot\n" fqp (this#get_slice_name ());flush logfd
end