From 81cece0dc62e1ba9d162ab12ae361b870d74568a Mon Sep 17 00:00:00 2001 From: ZoRo Date: Sat, 27 Jun 2020 18:02:17 +0100 Subject: oecho,omkdir,ormdir,omkfile --- omkfile/Makefile | 8 ++++++++ omkfile/omkfile.ml | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 omkfile/Makefile create mode 100644 omkfile/omkfile.ml (limited to 'omkfile') diff --git a/omkfile/Makefile b/omkfile/Makefile new file mode 100644 index 0000000..368a183 --- /dev/null +++ b/omkfile/Makefile @@ -0,0 +1,8 @@ +make: + ocamlc unix.cma str.cma omkfile.ml -o omkfile + +static: + ocamlopt unix.cmxa -ccopt -static omkfile.ml -o omkfile + +clean: + rm -f *.cmi *.cmx *.o *.cmo \ No newline at end of file diff --git a/omkfile/omkfile.ml b/omkfile/omkfile.ml new file mode 100644 index 0000000..fbc7a6d --- /dev/null +++ b/omkfile/omkfile.ml @@ -0,0 +1,13 @@ +open Arg +open Scanf +open Printf +open Unix + +let argnum = Array.length Sys.argv + +let _ = + if argnum >= 2 then + let fd = openfile Sys.argv.(1) [Unix.O_RDWR;Unix.O_CREAT] 0o666 + in close fd + else + Printf.printf "ERR only one argument\n" \ No newline at end of file -- cgit v1.2.3