D2Drop
Drop a file to a target system by providing its path on the server. Use CopyFileD2 instead in most cases. This is a utility agent script to be used inside server scripts. See CopyFileD2 for an example.
javascript · D2 (Deprecated)
Source
var tempDir = ''; if( env.TEMP ) { tempDir = env.TEMP; } else if ( env.TMPDIR ) { tempDir = env.TMPDIR; } else if ( env.TMP) { tempDir = env.TMP; } else { tempDir = '/tmp'; } var filesRes = files( tempDir, true, false, args.files ); if ( filesRes && filesRes.length > 0 ) { if ( 1 != copy( filesRes[0].Path, args.destpath, args.force === 'true') ) throw "Error copying file " + filesRes[0].Path + " to " + filesRes[0].destpath + "."; else pack("File copied successfully."); } else { pack("Failed to find temp file."); }
README
Drops a file to a target system by providing its path on the server. In most cases use CopyFileD2 instead.
This is a utility agent script to be used inside server scripts. See CopyFileD2 for an example.
Script Data
| Name | Description |
|---|---|
| Script Type | javascript |
| Tags | agent, util |
Inputs
| Argument Name | Description |
|---|---|
| destpath | The full filesystem path and filename under which to save the file. |
| files | The source file name. |
| force | The overwrite file. |
Outputs
There are no outputs for this script.