DO /p and EVERYTHING

samintz

Scott Mintz
May 20, 2008
1,270
11
Solon, OH, USA
#1
When I issue the following command TCC returns an in-use error message:
Code:
[C:\TC16] do v in /p (everything -w view.dat) (echo ctbackup %@path[%v])
TCC: (Sys) The process cannot access the file because it is being used by another process.
"C:\Temp\DO_A986.tmp"
I can rearrange the command slightly and use a pipe, and this works:
Code:
[C:\TC16] everything /w view.dat | (do v in @con (echo ctbackup %@path[%v]))
ctbackup C:\CCViews\bug_r22\
ctbackup C:\CCViews\dev_rearch_step4\
TCC 16.00.40 x64 Windows 7 [Version 6.1.7601]
TCC Build 40 Windows 7 Build 7601 Service Pack 1
 

rconn

Administrator
Staff member
May 14, 2008
10,434
95
#2
When I issue the following command TCC returns an in-use error message:
Code:
[C:\TC16] do v in /p (everything -w view.dat) (echo ctbackup %@path[%v])
TCC: (Sys) The process cannot access the file because it is being used by another process.
"C:\Temp\DO_A986.tmp"
Not reproducible here.

Your command syntax is somewhat problematic -- DO doesn't expect two unconnected command groups as a single DO command line argument -- where did you see that syntax?
 

samintz

Scott Mintz
May 20, 2008
1,270
11
Solon, OH, USA
#3
It wasn't my original syntax. I was playing with command groups to see if that made any difference. I ran my script and it seemed to hang at the point where it was searching for all my view.dat files. I don't know why it hung. Something with FFIND wasn't working right. The FOR statement at the end of this code snippet is what was hung. It never made it to the GOSUB call.
Code:
echo ::::::::::::::::::::::::::::
echo :: Locate all the snapshot view directories by finding all the view.dat files
echo ::::::::::::::::::::::::::::
unset /q sl & for /f %d in ('subst') set sl=%[sl]%@left[1,%d]
do d in /P CDD /A
  :: networked and CD drives are skipped
  if %@remote[%d]==1 .or. %@cdrom[%d]==1 iterate
  :: subst'ed drives are skipped too
  if %@index[%sl,%@left[1,%d]] NE -1 iterate

  :: d is a valid drive letter
  for /f %v in ('ffind /A:H /V /K /M /S %@left[2,%d]\view.dat') do gosub BackupSnapshot %v
enddo
I did a Ctrl+C break to terminate the script and then tried to back up my snapshot view individually using the DO statement from my first post and started getting those errors. I also got those errors if I used a |! pipe instead of a regular pipe.
Code:
this generated the same in use errors:
everything /w view.dat |! (do v in @con (echo ctbackup %@path[%v]))