Ctrl-C from within a library function

Dec 2, 2008
224
2
Canada
When I do a Ctrl-C while executing within a function from a library, current TCC seems to hang on the "Cancel batch job BatchName ? (Y/N/A) : y".

I put a PAUSE in the function and Ctrl-C on the PAUSE and it hangs.

Craig
 
Dec 2, 2008
224
2
Canada
I put a "ON BREAK EXIT" and it did exit.

Without the ON BREAK, Ctrl-C takes me to "Cancel batch job BatchName ? (Y/N/A) : y" and it freezes, the only thing I can do is to kill the current TCC process.
 
May 20, 2008
10,684
83
Syracuse, NY, USA
I did a little testing. It seems to depend on what the library routine is doing. "Cancel batch job ..." works fine it the library routine is doing internal stuff. It also works fine if the library routine is doing

Code:
2>nul %@execarray[a,schtasks /query /V]

But if the library routine is doing this

Code:
iff %@execarray[s,cscript //nologo //job:SVJOB "d:\data\tcclibrary\sv.btm?.wsf"] != 0 then
        echo cscript error
        goto done
endiff

TCC will disappear every time when Ctrl-C is pressed (and will occasionally be restarted by Windows).

Cgunhouse ... I'm curious ... what's the library routine doing?
 
Dec 2, 2008
224
2
Canada
The routine is going through directories using a "for /r"

I have a Cloud Sync directory that I copy files to, but rather than put the files in the directory I am putting a hard link to save on disk space. Before a file is copied (or a link is created) it test to see if the file is already a link to that file. If it is it moves on to the next file. If it isn't the file is deleted from the Sync Directory and a new link is created.

I'm actually having a hard time getting it to work, the Ctrl-C issue did help. Any ideas would be helpful.

Cap "Y" does seem to work, but I would have thought lowercase "y" would too.