[MLton-commit] r5407
Vesa Karvonen
vesak at mlton.org
Wed Mar 7 05:30:28 PST 2007
Renamed Path to File and added File.copy.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/windows/unstable/detail/ffi/windows.h
U mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml
U mltonlib/trunk/com/ssh/windows/unstable/public/windows-ex.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/windows/unstable/detail/ffi/windows.h
===================================================================
--- mltonlib/trunk/com/ssh/windows/unstable/detail/ffi/windows.h 2007-03-06 17:31:46 UTC (rev 5406)
+++ mltonlib/trunk/com/ssh/windows/unstable/detail/ffi/windows.h 2007-03-07 13:30:27 UTC (rev 5407)
@@ -67,6 +67,7 @@
/************************************************************************/
+WIN_FUNCTION(CopyFile, BOOL, 3, (LPCTSTR, LPCTSTR, BOOL))
WIN_FUNCTION(GetShortPathName, DWORD, 3, (LPCTSTR, LPTSTR, DWORD))
/************************************************************************/
Modified: mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml
===================================================================
--- mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml 2007-03-06 17:31:46 UTC (rev 5406)
+++ mltonlib/trunk/com/ssh/windows/unstable/detail/windows.sml 2007-03-07 13:30:27 UTC (rev 5407)
@@ -310,13 +310,21 @@
end
end
- structure Path = struct
+ structure File = struct
fun getShortName p =
one (withZs p)
(fn p' =>
onError0ElseRequiredSize
(fn () => F"Path.getShortName"[A str p])
(fn (b, s) => F_win_GetShortPathName.f' (p', b, s)))
+
+ fun copy {from, to, failIfExists} =
+ one (withZs from >>& withZs to)
+ (fn from' & to' =>
+ raiseOnFalse
+ (fn () => F"File.copy"[A str from, A str to,
+ A bool failIfExists])
+ F_win_CopyFile.f' (from', to', toCBool failIfExists))
end
structure Wait = struct
Modified: mltonlib/trunk/com/ssh/windows/unstable/public/windows-ex.sig
===================================================================
--- mltonlib/trunk/com/ssh/windows/unstable/public/windows-ex.sig 2007-03-06 17:31:46 UTC (rev 5406)
+++ mltonlib/trunk/com/ssh/windows/unstable/public/windows-ex.sig 2007-03-07 13:30:27 UTC (rev 5407)
@@ -27,8 +27,9 @@
val getFileName : t Option.t -> String.t
end
- structure Path : sig
+ structure File : sig
val getShortName : String.t UnOp.t
+ val copy : {from : String.t, to : String.t, failIfExists : Bool.t} Effect.t
end
structure Wait : sig
More information about the MLton-commit
mailing list