FileMoveAttr

Moves files, and sets file attributes..

Syntax:

FileMoveAttr (source-list, destination, warning, attributes)

Parameters:

(s) source-list one or more filenames separated by a delimiter.

(s) destination target filename.

(i) warning @TRUE if you want a warning before overwriting existing files; @FALSE if no warning desired.

(s) attributes attributes to be modified.

Returns:

(i) @TRUE if the file was moved. (see note).

 

Note: If warning parameter is set to @TRUE , then the return value will be @TRUE, even if it was modified by the user dialog.

Use this function to move an individual file, a group of files using wildcards, or several groups of files by separating the names with a delimiter.

You can move files to another drive. You can also move a file to a COM or LPT port, which would cause the file to be copied to the port and then deleted (do not put a colon after the name of the port).

Source-list and destination may contain * and ? wildcards.

attribute: The attribute string consists of one or more of the following characters (an upper case letter turns the specified attribute ON, a lower case letter turns it OFF):

Symbol Meaning

Symbol Meaning

R read only ON
A archive ON
S system ON
H hidden ON

r read only OFF
a archive OFF
s system OFF
h hidden OFF

 

Windows Vista/2008 and newer: This function may require an Administrator level account if dealing with files located in a protected directories: 'Program Files' and 'Windows'.

Examples:

temp=Environment("TEMP")
DirChange(temp)
testfile1="test1.txt"
testfile2="test2.txt"
handle = FileOpen(testfile1, "write")
FileWrite(handle, "dummy data one")
FileClose(handle)
FileMoveAttr(testfile1, testfile2, @FALSE,"R")
Message("FileMove","File Moved withRead Only attribute set")

 

See Also:

FileCopy, FileCopyAttr, FileMove, IntControl 29