Hi,
Although I have used BC for several years, this is my first attempt at scripting.
Probably this is an error in understanding how the scripting language works
Here is a script that I generate and run
# beyond compare script generated by c:\ooRexx\makeHotkeyUpdate.rex 2 Aug 2010 14:27:21
# This script produces a hotkey auto update zip file
# and keeps the master source up to date.
#
log verbose c:\logs\bcHotkey.log
option confirm:yes-to-all
# compare using crc
criteria timestamp:6sec;IgnoreDST crc
# Load the default session and exclude most file types
load <default>
filter "*.bmp;*.kbm;-local*.kbm"
# load current files against Master Source
load "C:\temp\BCTest\Dev\System" "C:\temp\BCTest\MasterSource\System"
# expand to affect subfolders and files
expand all
# select updated files
select lt.newer.files lt.orphan.files
# copy changes to a .zip file
copyto lt path:relative "C:\temp\BCTest\FTPsite\Hotkeys\2010-08-02.zip"
# print summary of files involved
folder-report layout:summary &
options:display-left-newer-orphans,column-none &
output-to:"C:\DOCUME~1\saha\LOCALS~1\Temp\HotKeyList.txt "
# now update the master source
sync update:left->right
Here is the log of it running
02/08/2010 14:27:22 >> load <default>
02/08/2010 14:27:22 >> filter "*.bmp;*.kbm;-local*.kbm"
02/08/2010 14:27:22 >> # load current files against Master Source
02/08/2010 14:27:22 >> load "C:\temp\BCTest\Dev\System" "C:\temp\BCTest\MasterSource\System"
02/08/2010 14:27:24 Load comparison: C:\temp\BCTest\Dev\System <-> C:\temp\BCTest\MasterSource\System
02/08/2010 14:27:24 >> # expand to affect subfolders and files
02/08/2010 14:27:24 >> expand all
02/08/2010 14:27:24 >> # select updated files
02/08/2010 14:27:24 >> select lt.newer.files lt.orphan.files
02/08/2010 14:27:24 >> # copy changes to a .zip file
02/08/2010 14:27:24 >> copyto lt path:relative "C:\temp\BCTest\FTPsite\Hotkeys\2010-08-02.zip"
02/08/2010 14:27:24 Copied C:\temp\BCTest\Dev\System\Bitmaps\JSGP902.bmp to C:\temp\BCTest\FTPsite\Hotkeys\2010-08-02.zip
02/08/2010 14:27:24 Successfully copied 1 items. Completed in 0.03 seconds.
02/08/2010 14:27:24 >> # print summary of files involved
02/08/2010 14:27:24 >> folder-report layout:summary &
02/08/2010 14:27:24 >> options:display-left-newer-orphans,column-none &
02/08/2010 14:27:24 >> output-to:"C:\DOCUME~1\saha\LOCALS~1\Temp\HotKeyList.txt "
02/08/2010 14:27:24 >> # now update the master source
02/08/2010 14:27:24 >> sync update:left->right
02/08/2010 14:27:24 Copied C:\temp\BCTest\Dev\System\Bitmaps\JSGP902.bmp to C:\temp\BCTest\MasterSource\System\Bitmaps
02/08/2010 14:27:24 Successfully synchronized 1 items. Completed in 0 seconds.
02/08/2010 14:27:24 Script completed in 1.88 seconds
and the log
Folder Compare
Produced: 02/08/2010 14:27:24
Mode: Left Newer and Left Orphans
Filters: *.bmp;*.kbm;-local*.kbm
Left base folder: C:\temp\BCTest\Dev\System
Right base folder: C:\temp\BCTest\MasterSource\System
Left Orphan Files (1)
---------------------
Bitmaps\JSGP902.bmp
---------------------
Left Newer Files (0)
---------------------
I expect it to find 1 file different (newer) and one orphan against this test data, but it is onlyfinding the orphan.
If I compare the folders using the GUI interface the different file is located using a CRC comparison
Here is a DIR for the lefthand file
C:\temp\BCTest\Dev\System\kbm>dir boxes.kbm
Volume in drive C is OS
Volume Serial Number is 0AE2-19CA
Directory of C:\temp\BCTest\Dev\System\kbm
02/08/2010 14:20 5,513 boxes.kbm
and here is one for the righthand file
C:\temp\BCTest\MasterSource\System\kbm>dir boxes.kbm
Volume in drive C is OS
Volume Serial Number is 0AE2-19CA
Directory of C:\temp\BCTest\MasterSource\System\kbm
10/07/2006 15:25 5,513 boxes.kbm
1 File(s) 5,513 bytes
showing they have considerably different file dates.
And here is the result of a ‘dos’ fc command showing they have different contents:
C:\temp\BCTest\MasterSource\System\kbm>fc boxes.kbm ..\..\..\dev\System\kbm\boxe
s.kbm
Comparing files boxes.kbm and ..\..\..\DEV\SYSTEM\KBM\BOXES.KBM
***** boxes.kbm
053,053,[10][03]JSGJ302[01],1,C:\TILL\SYSTEM\BITMAPS\JSGJ302.bmp,1
054,054,[10][03]JSGP901[01],1,C:\TILL\SYSTEM\BITMAPS\JSGP901.bmp,1
055,055
***** ..\..\..\DEV\SYSTEM\KBM\BOXES.KBM
053,053,[10][03]JSGJ302[01],1,C:\TILL\SYSTEM\BITMAPS\JSGJ302.bmp,1
054,054,[10][03]JSGP902[01],1,C:\TILL\SYSTEM\BITMAPS\JSGP902.bmp,1
055,055
*****
I would expect the line
criteria timestamp:6sec;IgnoreDST crc
To look for differences in the timestamp OR crc and in this case I think we should get a hit on both counts
I would also expect the line
select lt.newer.files lt.orphan.files
to select BOTH left.newer.files AND left.orphan.files
Is that not correct?
Thanks for any help you can give me
BC 3.1.11 (build 12204) Windows XP – all files are on local disks.
Although I have used BC for several years, this is my first attempt at scripting.
Probably this is an error in understanding how the scripting language works
Here is a script that I generate and run
# beyond compare script generated by c:\ooRexx\makeHotkeyUpdate.rex 2 Aug 2010 14:27:21
# This script produces a hotkey auto update zip file
# and keeps the master source up to date.
#
log verbose c:\logs\bcHotkey.log
option confirm:yes-to-all
# compare using crc
criteria timestamp:6sec;IgnoreDST crc
# Load the default session and exclude most file types
load <default>
filter "*.bmp;*.kbm;-local*.kbm"
# load current files against Master Source
load "C:\temp\BCTest\Dev\System" "C:\temp\BCTest\MasterSource\System"
# expand to affect subfolders and files
expand all
# select updated files
select lt.newer.files lt.orphan.files
# copy changes to a .zip file
copyto lt path:relative "C:\temp\BCTest\FTPsite\Hotkeys\2010-08-02.zip"
# print summary of files involved
folder-report layout:summary &
options:display-left-newer-orphans,column-none &
output-to:"C:\DOCUME~1\saha\LOCALS~1\Temp\HotKeyList.txt "
# now update the master source
sync update:left->right
Here is the log of it running
02/08/2010 14:27:22 >> load <default>
02/08/2010 14:27:22 >> filter "*.bmp;*.kbm;-local*.kbm"
02/08/2010 14:27:22 >> # load current files against Master Source
02/08/2010 14:27:22 >> load "C:\temp\BCTest\Dev\System" "C:\temp\BCTest\MasterSource\System"
02/08/2010 14:27:24 Load comparison: C:\temp\BCTest\Dev\System <-> C:\temp\BCTest\MasterSource\System
02/08/2010 14:27:24 >> # expand to affect subfolders and files
02/08/2010 14:27:24 >> expand all
02/08/2010 14:27:24 >> # select updated files
02/08/2010 14:27:24 >> select lt.newer.files lt.orphan.files
02/08/2010 14:27:24 >> # copy changes to a .zip file
02/08/2010 14:27:24 >> copyto lt path:relative "C:\temp\BCTest\FTPsite\Hotkeys\2010-08-02.zip"
02/08/2010 14:27:24 Copied C:\temp\BCTest\Dev\System\Bitmaps\JSGP902.bmp to C:\temp\BCTest\FTPsite\Hotkeys\2010-08-02.zip
02/08/2010 14:27:24 Successfully copied 1 items. Completed in 0.03 seconds.
02/08/2010 14:27:24 >> # print summary of files involved
02/08/2010 14:27:24 >> folder-report layout:summary &
02/08/2010 14:27:24 >> options:display-left-newer-orphans,column-none &
02/08/2010 14:27:24 >> output-to:"C:\DOCUME~1\saha\LOCALS~1\Temp\HotKeyList.txt "
02/08/2010 14:27:24 >> # now update the master source
02/08/2010 14:27:24 >> sync update:left->right
02/08/2010 14:27:24 Copied C:\temp\BCTest\Dev\System\Bitmaps\JSGP902.bmp to C:\temp\BCTest\MasterSource\System\Bitmaps
02/08/2010 14:27:24 Successfully synchronized 1 items. Completed in 0 seconds.
02/08/2010 14:27:24 Script completed in 1.88 seconds
and the log
Folder Compare
Produced: 02/08/2010 14:27:24
Mode: Left Newer and Left Orphans
Filters: *.bmp;*.kbm;-local*.kbm
Left base folder: C:\temp\BCTest\Dev\System
Right base folder: C:\temp\BCTest\MasterSource\System
Left Orphan Files (1)
---------------------
Bitmaps\JSGP902.bmp
---------------------
Left Newer Files (0)
---------------------
I expect it to find 1 file different (newer) and one orphan against this test data, but it is onlyfinding the orphan.
If I compare the folders using the GUI interface the different file is located using a CRC comparison
Here is a DIR for the lefthand file
C:\temp\BCTest\Dev\System\kbm>dir boxes.kbm
Volume in drive C is OS
Volume Serial Number is 0AE2-19CA
Directory of C:\temp\BCTest\Dev\System\kbm
02/08/2010 14:20 5,513 boxes.kbm
and here is one for the righthand file
C:\temp\BCTest\MasterSource\System\kbm>dir boxes.kbm
Volume in drive C is OS
Volume Serial Number is 0AE2-19CA
Directory of C:\temp\BCTest\MasterSource\System\kbm
10/07/2006 15:25 5,513 boxes.kbm
1 File(s) 5,513 bytes
showing they have considerably different file dates.
And here is the result of a ‘dos’ fc command showing they have different contents:
C:\temp\BCTest\MasterSource\System\kbm>fc boxes.kbm ..\..\..\dev\System\kbm\boxe
s.kbm
Comparing files boxes.kbm and ..\..\..\DEV\SYSTEM\KBM\BOXES.KBM
***** boxes.kbm
053,053,[10][03]JSGJ302[01],1,C:\TILL\SYSTEM\BITMAPS\JSGJ302.bmp,1
054,054,[10][03]JSGP901[01],1,C:\TILL\SYSTEM\BITMAPS\JSGP901.bmp,1
055,055
***** ..\..\..\DEV\SYSTEM\KBM\BOXES.KBM
053,053,[10][03]JSGJ302[01],1,C:\TILL\SYSTEM\BITMAPS\JSGJ302.bmp,1
054,054,[10][03]JSGP902[01],1,C:\TILL\SYSTEM\BITMAPS\JSGP902.bmp,1
055,055
*****
I would expect the line
criteria timestamp:6sec;IgnoreDST crc
To look for differences in the timestamp OR crc and in this case I think we should get a hit on both counts
I would also expect the line
select lt.newer.files lt.orphan.files
to select BOTH left.newer.files AND left.orphan.files
Is that not correct?
Thanks for any help you can give me
BC 3.1.11 (build 12204) Windows XP – all files are on local disks.
Comment