Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying files in Aspect 1

Status
Not open for further replies.

Yoplait

Programmer
Sep 2, 2003
3
US
Hi all,

I'm having trouble copying my capture file to a shared directory. Any assistance would be very appreciated.

This script creates a capture file "temp.txt". At 1:00am, the capture file is renamed to a time/datestamp. Next, it is supposed to copy the new file to a shared directory. At 1:01am, I re-start the capture file.

The script compiles and runs just fine, but never copies the file. Here is the code (some of this will look familiar, I've snatched bits and pieces from other threads in this forum):

proc main
string sCapPath, sCapFile, sCapFile2, sNewFile, sCmdLine
integer iYear, iMonth, iDay, iHour, iMin, iSec, iCount

set capture file "temp.txt"
fetch capture path sCapPath
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

capture on

iCount = 0

while 1
yield
while 1
yield
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

if iHour == 1
if iMin == 00
if iCount == 0
capture off
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sNewFile "%02d%02d%02d" iMonth iDay iYear
strcat sNewFile ".TXT"
strfmt sCapFile "%s\temp.txt" sCapPath
strfmt sCapFile2 "%s\%s" sCapPath sNewFile
shortpath sCapFile sCapFile
rename sCapFile sCapFile2
strfmt sCmdLine "copy /y %s F:\Users\phone\capture.txt" sCapFile2
dos sCmdLine MINIMIZED
iCount = 1
endif
endif

if iMin == 01
capture on
iCount = 0
endif
endif
endwhile
endwhile
endproc
 
I don't see anything obviously wrong with the script. If you run the copy command manually without the script, does the copy operation proceed correctly?

You might also try using the copyfile command instead of creating your own command line and running that.




aspect@aspectscripting.com
 
Knob,

Thanks for the reply.

What is the syntax for copyfile?
 
Knob,

That did the trick. Not sure why the dos command didn't work, but copyfile did.

One last question for you: Is there a list of commands with syntax available anywhere on the web? I wasn't able to find it on and I think it would be a very useful reference. I'd like to get a little more creative with these scripts, but don't have the learning tools I need. Any ideas?

Thanks!
 
There may be a list in some of the Symantec documentation I link to (the tutorial PDF files on the version 4.8 CD specifically), but I think the best list is in the ASPECT help file. You can get there via the Help | Script Reference menu item in Procomm. Click on the Contents tab if necessary, then double click ASPECT Command Reference. You can see the commands either by function or alphabetically, as well as scroll through discussion for all commands.



aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top