include DkCoder_Std.SCRIPT
__init context is the entry point for running a script module. The DkCoder compiler will inject this function at the top and bottom of the script module. The top __init does nothing, while the bottom __init calls the prior __init.
That means:
- calling the
__initfunction guarantees that the script module is initialized; that is, all of the script module's side-effects (ex.let () = Format.printf "Hello world@.") are executed before the__initreturns to the caller. - you can override the
__initfunction by simply defining the__initidempotently. That will shadow the top__initand when the bottom__initis executed your__initwill be called instead of the do-nothing top__init.
Future versions of DkCoder will call __init in dependency order for all `You script modules. Your __init function may be called several times.
__repl context is the entry point for debugging a script module in a REPL. The DkCoder compiler will inject this function at the top and bottom of the script module. The top __repl does nothing, while the bottom __repl calls the prior __repl.
That means:
- you can override the
__replfunction by simply defining the__replidempotently. That will shadow the top__repland when the bottom__replis executed your__replwill be called instead of the do-nothing top__repl.
The run-time module information for the script module.
val copy :
?mode:int ->
?bufsize:int ->
?parents:unit ->
src:Tr1Fpath_Std.Fpath.t ->
dest:Tr1Fpath_Std.Fpath.t ->
unit ->
(unit, [ `Msg of string ]) Stdlib414Shadow.resultcopy ?mode ?bufsize ?parents ~src ~dest () copies the source file src to the destination file dest.
Use the option mode = 0o700 (etc.) to change the file permissions of the destination file dest. Defaults to mode = 0o644 which is readable by everyone yet writeable by the user.
The option bufsize is the size of the memory buffer used during copying. It defaults to 1MB.
Use the flag ~parents:() to create any missing parent directories of the destination file dest.
On Windows long paths are not supported.

