PDA

View Full Version : Scripts needs up to 90% CPU and does not end


PellerM
10-Dec-2004, 04:53 AM
Hi, I am a BC2 newbie. I just started to write a small script:

log verbose d:\log.txt
load c:\temp
select all
file-report layout:side-by-side output-to:d:\out2.txt

just only to start bc2 scripting. But the script does not end and consumes 90% CPU. What is my mistake? Please help.

Thanks, Michael

chrroe
10-Dec-2004, 05:38 AM
Hi Michael!

I was able to reproduce this funny symptoms, but as far as I could figure out Beyond Compare acts properly!
But first of all some comments to your script (It does not make much sense IMHO):

With 'load c:\temp' you are only using one directory! Later you want to make a file-report. Against what is c:\temp to be compared?

I would suggest to load 2 directories and then try the folder-report command.
Or what exacly do you want as result?

BC of course uses CPU when generating a report. But it does not hang. This can be confirmed by using the famous 'File Monitor' from www.sysinternals.com (http://www.sysinternals.com) :D

When you let your script run long enough it will surely end, but the report-file will be gigantic ...

Bye
Christoph

PellerM
10-Dec-2004, 09:46 AM
Thanks for your response, Christoph!

I added an additional folder d:\temp in respect to your answer - nothing changed. Up to 90% CPU, not ending.

log verbose d:\log.txt
load c:\temp d:\temp
select all
file-report layout:side-by-side output-to:d:\out2.txt

The contents of the both \temp folder is more then less 9 items on c:\temp, 1 on d:\temp, no subfolders. Just only todo something. I only expect a small list with the contents of both \temp folders.

My intention is only to get familiar with the scripting feature of BC2. So I had the idea to pick up one folder or two and print something. Only to see how it works.

As I said, I am a BC2 newbie. But I am not a Computer newbie at all. So, when I get in touch with a new programming or scripting language I start doing something very simple, e.g. in that current case, printing something to see how things are working.

Regards, Michael

PellerM
10-Dec-2004, 10:26 AM
I've got it! The answer is "folder-report" instead of "file-report". file-report prints the contents of each file ...
By the way, it's not necessary to load more then one folder if you want to print only the contents of that folder.

Michael

log verbose d:\log.txt
load c:\temp
select all
folder-report layout:side-by-side output-to:d:\out2.txt

Chris
10-Dec-2004, 10:40 AM
The file-report command only works on files, not folders, so it may help to modify your script to:

log verbose log.txt
load c:\temp d:\temp
expand all
select all.files
file-report layout:side-by-side output-to:d:\out2.txt

Also, make sure you're running the latest release of BC.