Skip to content

FILE_COPY

FILE_COPY copies a file. The command can be used for coping files on the home system and from and to the ADOxx database.

Syntax

leo-grammar
CC "AdoScript" FILE_COPY from:strValue to:strValue [ copy-file-attributes ]

# --> RESULT ecode:intValue
CC "AdoScript" FILE_COPY from:strValue to:strValue [ copy-file-attributes ]

# --> RESULT ecode:intValue

Parameters

  • from (strValue) - specifies the path for source file
  • to (strValue) - specifies the path for target file
  • copy-file-attributes(modifier, optional) - If copy-file-attributes is specified, additionally the file attributes of the source file are copied/set to the target file. E.g., if the source file is write-protected, so will be the target file. This will only work if none of the files are ADOxx database files!

Returns

  • ecode (intValue) - has the value 0 if no errors occurred, 1 if the file was not copied.

Details

Relative paths relate to the current working directory (CWD).

Files stored in the ADOxx database can be copied by preceding the filename with ths string db:\\

The destination file can only be created if the full filename (drive letter + absolute path + file name) is not longer than 260 characters.

See Also

Examples

asc
CC "AdoScript" FILE_DIALOG open 
   filter1:"HTML Files" type1:"**.htm" default-ext:"htm" 
	
CC "AdoScript"  GET_TEMP_FILENAME

CC "AdoScript" FILE_COPY from:(path) to:(filename)
IF (ecode = 0) {
   CC "AdoScript" INFOBOX ("Copied the file " + path + " to " + filename)
}
CC "AdoScript" FILE_DIALOG open 
   filter1:"HTML Files" type1:"**.htm" default-ext:"htm" 
	
CC "AdoScript"  GET_TEMP_FILENAME

CC "AdoScript" FILE_COPY from:(path) to:(filename)
IF (ecode = 0) {
   CC "AdoScript" INFOBOX ("Copied the file " + path + " to " + filename)
}

Lets the user select a file and copies it to the temp directory.

Versions and Changes

Available since ADOxx 1.3