|

the software that grows
with you
| |
|
V32FileOperation()
|
| Perorms Move, Copy, Delete and Rename
operation on a single or a group of files through Windows API. |
|
Syntax
|
| V32FileOperation( <nAction>,
<acFilesSource>, [acFilesDest], [lFilesOnly], [nModeProgress],
[cTitleProgress], [lNoConfirm], [lNoConfMkDir], [lNoRecursive],
[lNoExposeErrors], [lModal] ) |
|
Arguments
|
| nAction |
Numeric representing the action to be
taken. It can be one of the following:
| VFO_MOVE |
1 |
| VFO_COPY |
2 |
| VFO_DELETE |
3 |
| VFO_RENAME |
4 |
|
| acFilesSource |
Character string or an array of character
elements representing the files on which the above action has to be
taken. Wildcards are supported while |
| acFilesDest |
Character string or an array of character
elements representing the files which will the results of
<nAction>. This parameter will be not be considered if
<nAction> = VFO_DELETE.
If <acFilesSource> is an array of file names then
<acFilesDest> can be either a charcter string pointing towars
the destination directory.
If <acFilesSource> is an array of file names then
<acFilesDest> is also an array, then the <acFilesDest>
must be equal to the length of <acFilesSource>. In this case
the <nAction> will be performed per file basis. Vouch32 checks
for the length of both arrays and does not care whether element
contents are valid or not. It is the responsibility of the developer
to set it correct.values.
If <nAction> = VFO_RENAME then woldcards are not supported
and number of elements in <acFilesSource> must equals
<acFilesDest>. |
| lFilesOnly |
Logical to specify if the operation is to
be performed on files only and not subdirectories. If
<acFilesSource> contains the wildcards such as '*.*' then this
parameter bears a meaning otherwise specific files will be treated
on per file basis. |
| nModeProgress |
Numeric to specify which type of progress
bar will be offered which file operation is being performed. It can
be one of the following:
| Windows Default (Default) |
1 |
| Simple Progress Bar without File
Names Display |
2 |
| Silent means no Progress
Bar |
3 |
|
| cTitleProgress |
Character string to be displayed on the
progress bar window. This has meaning only when
<nModeProgress> = 2. |
| lNoConfirm |
Logical to specify should Windows ask for
confirmation if something different than desired happens, such as,
the file being copied already exists at the destination, etc. By
default its value is FALSE means Windows will ever gets the node
before performng such action. |
| lNoConfMkDir |
Reserved for future usage. |
| lNoRecursive |
This parameter is identical to
<lFilesOnly>. |
| lNoExposeErrors |
Logical to specify whether Windows stops
opening the relevant dialog if some error occurs. By default it is
FALSE means Windows always inform about the error occured. |
| lModal |
Logical to specify whether the said
operation be performed in a separate thread of application wait for
the operation to complete. By default it is FALSE means the said
operation will be performed at the background in modeless state. |
|
|
Returns
|
| Numeric error code. |
|
Description
|
| |
|
Usage
|
#include "Vouch32.ch"
local cSource, aSource, cDest, aDest, nAction, lFilesOnly
local nModeProg, cTitleProg, lNoConfirm
cSource := 'c:\Windows\System\*.*'
cDest := 'd:\Backup\System\'
nAction := VFO_COPY
lFilesOnly := .t.
nModeProg := 1
cTitleProg := 'Copying Files'
lNoConfirm := .f.
V32FileOperation( nAction, cSource, cDest, lFilesOnly, nModeProg, cTitleProg, lNoConfirm )
|
|
Tips
|
| A very handy function to invoke Windows
API to be exploited in Clipper and XBase++ applications. |
|