Copying creates new file info, moving retains the old.

;To copy a file...

kern32: load/library %kernel32.dll

    CopyIt: make routine! [
        lpExistingFileName  [string!]
        lpNewFileName [string!]
        bFailIfExists    [integer!]
        return:     [integer!]
    ] kern32 "CopyFileA"

;CopyIt "C:/original.r" "C:/trash/copy.r" 0

;To move a file...

    MoveIt: make routine! [
        lpExistingFileName  [string!]
        lpNewFileName [string!]
    ] kern32 "MoveFileA"

;MoveIt "C:/file.r" "D:/file.r"

TBrownell

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 13, 2002 1:18 AM
Subject: [REBOL] Re: Using call with view/pro


> Hi Gregg,
>
> Running executables/batch files works OK.
>
> However I particularly wanted to copy a file from 1 location to another on
Win98 without having to read the file in in Rebol and writting it back out
again.
> This would preserve the date/time stamp.
>
> I am unsure as to what I should pass into file .... or is there a
different API
> for this?
>
> Cheers Phil
>
> (I have successfully made a batch file that receieves parameters that does
the job).
>
> === Original Message ===
>
> Hi Phil,
>
> << On Win98 when I run a native command using 'call is it possible to stop
> the MS DOS box being flashed up. >>
>
> Someone had this issue a while back, and calling the API directly solved
it,
> if you're not concerned about portability. Here's an excerpt from an
object
> I use with various API stuff in it:
>
>     win-lib: load/library %shell32.dll
>
>     execute: make routine! [
>         hwndParent  [integer!]
>         Operation   [string!]
>         File        [string!]
>         Parameters  [string!]
>         Directory   [string!]
>         ShowCmd     [integer!]
>         return:     [integer!]
>     ] win-lib "ShellExecuteA"
>
>     ; Operation values
>     ;   "open"
>     ;   "print"
>     ;   "explore"
>     ; ShowCmd values
>     ;     0   Hides the window and passes activation to another window.
>     ;
>     ;     1   Activates and displays a window. If the window is minimized
>     ;         or maximized, Windows restores it to its original size and
>     ;         position (same as 9).
>     ;
>     ;     2   Activates a window and displays it as an icon.
>     ;
>     ;     3   Activates a window and displays it as a maximized window.
>     ;
>     ;     4   Displays a window in its most recent size and position. The
>     ;         window that is currently active remains active.
>     ;
>     ;     5   Activates a window and displays it in its current size and
>     ;         position.
>     ;
>     ;     6   Minimizes the specified window and activates the top-level
>     ;         window in the system's list.
>     ;
>     ;     7   Displays a window as an icon. The window that is currently
>     ;         active remains active.
>     ;
>     ;     8   Displays a window in its current state. The window that is
>     ;         currently active remains active.
>     ;
>     ;     9   Activates and displays a window. If the window is minimized
>     ;         or maximized, Windows restores it to its original size and
>     ;         position (same as 1).
>
>
> execute 0 "open" "notepad.exe" "" "" 1
> execute 0 "open" "calc.exe" "" "" 1
>
> HTH!
>
> --Gregg
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to