let is_simple_filename s =
let ls = String.length s in
ls <> 0 &&
let rec loop pos =
if pos >= ls then true else
match s.[pos] with
| 'a'..'z' | 'A'..'Z' | '0'..'9' | '.' | '-' | '/' | '_' | ':' | '@' | '+' | ',' -> loop (pos + 1)
| _ -> false in
loop 0