/* FILEUPLOAD - Part Common by iri - http://www.irizone.net july 2007 under GNU/GPL v3 licence */ fun searchLastpoint(s)= let strlen s -> n in let n-1 -> i in ( while (i >= 0) && ((nth_char s i) != '.) do set i = i-1; i );; fun getExtensionFromFile(file)= let searchLastpoint file -> i in substr file i 10;; fun cmpcli(cli1, cli2)= cli1 == cli2;; fun is_in_list (l, x)= // lib. Marc Barilley if l==nil then 0 else let l->[a nxt] in (a==x)||is_in_list nxt x;; fun is_string_in_list (l, string)= // lib. Marc Barilley (l!=nil)&&((!strcmp string hd l)||(is_string_in_list tl l string));; fun getPathFile (longfile, file)= // lib. Marc Barilley if (longfile==nil) || (strlen longfile)==0 || (nth_char longfile ((strlen longfile)-1)) == '/ then [longfile file] else getPathFile substr longfile 0 (strlen longfile)-1 strcat substr longfile ((strlen longfile)-1) 1 file;;