Posted by Grant Foraker on May 01, 2006 at 10:11:24:
Testing CopyFile to archive PDF files from a users C: drive to a network share. I want to create the ABC subdirectory if it doesn't already exist and overwrite any matching file.
=====================================================================
LET FLAGS = 2048 + 4096
PRINT (CopyFile=PDFNAME$,ARCNAME$,FLAGS)
INPUT (0,ResultFmt)
AX$ = SUB(AX$,2,1) + SUB(AX$,1,1) ! Flip the bytes around
DX$ = SUB(DX$,2,1) + SUB(DX$,1,1) ! Flip the bytes around
FuncError = HexDec(AX$) ! Function error code (decimal)
FileError = HexDec(DX$) ! File error code (decimal)
! For unexpected values, convert to 2's complement signed integer
If (FuncError > 32767) FuncError = FuncError-65536
If (FileError > 32767) FileError = FileError-65536
Print @(0,6);'5 Func=';FuncError
Print @(0,7);'6 File=';FileError
===================================================================
TEST PDF ARCHIVE 2
1 C:\pdfFactory\AutoSave\TESTPDF2 (T00)[492].pdf
2 TESTPDF2 (T00)[492].pdf
3 \\SSASD00\TRANSFER\ABC\
4 \\SSASD00\TRANSFER\ABC\TEST.PDF
5 Func= 22
6 File= 0
1 is file and path from # buffer
2 is file name
3 is destination path, directory ABC doesn't exist
4 is destination path and file name without an imbedded space.
If the ABC directory exists, I get a sucessfull copy with 1/0 results.
I didn't see any "@00@" in the examples so I'm not adding a null to the paths.