simple-learning

Simple learning web program
git clone git://git.laack.co/simple-learning.git
Log | Files | Refs | README | LICENSE

shared.ml (485B)


      1 (* ALWAYS pass in directory to watch. Fallback should only be for tests. *)
      2 let course_dir =
      3   if Array.length Sys.argv > 1 then Sys.argv.(1) ^ "/" else "./test_courses/"
      4 
      5 let is_file filename = if Sys.file_exists filename then true else false
      6 
      7 let is_directory path =
      8   if Sys.file_exists path then if Sys.is_directory path then true else false
      9   else false
     10 
     11 let match_on_prefix s prefix =
     12   String.length s >= String.length prefix
     13   && String.sub s 0 (String.length prefix) = prefix