Changeset 4639 for trunk/tools


Ignore:
Timestamp:
Nov 20, 2000, 4:09:38 AM (25 years ago)
Author:
bird
Message:

Added option -s for skipping locked directories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/DoWithDirs.cmd

    r4615 r4639  
    1 /* $Id: DoWithDirs.cmd,v 1.6 2000-11-19 08:22:30 bird Exp $
     1/* $Id: DoWithDirs.cmd,v 1.7 2000-11-20 03:09:38 bird Exp $
    22 *
    33 * Syntax: dowithdirs.cmd [-e<list of excludes>] [-c] [-i] [-l] [-r] <cmd with args...>
     
    1111 *            Processing stops (rc=0) on the first locked directory.
    1212 *            <tag> is a name of the lock.
     13 *    -s      Skip locked directories in stead of stopping.
    1314 */
    1415
     
    2122    fCD = 0;
    2223    fLocking = 0;
     24    fDontStop = 0;
    2325    fReverse = 0;
    2426    fExitOnLock = 1;
     
    2628
    2729    /* parse arguments */
    28     parse arg sArg.1 sArg.2 sArg.3 sArg.4 sArg.5 sArg.6 sArg.7
    29     sArg.0 = 7;
     30    parse arg sArg.1 sArg.2 sArg.3 sArg.4 sArg.5 sArg.6 sArg.7 sArg.8 sArg.9
     31    sArg.0 = 9;
    3032    do i = 1 to sArg.0
    3133        if (sArg.i <> '') then
     
    8082                    end
    8183
     84                    when ch = 'S' then
     85                    do
     86                        fDontStop = 1;
     87                    end
     88
    8289                    otherwise
    8390                        say 'unknown argument:' sArg.i;
     
    154161                            /* restore old directory and return sucessfully */
    155162                            call directory sOldDir;
    156                             say '[ - Lock found, stops processing.]';
    157                             exit(0);
     163                            if (fDontStop) then
     164                            do
     165                                say '[ !Lock found, skips directory.]';
     166                                iterate;
     167                            end
     168                            else
     169                            do
     170                                say '[ !Lock found, stops processing.]';
     171                                exit(0);
     172                            end
    158173                        end
    159174                        say '[ - warning: Skipping '|| asDirs.i || ' - directory was locked.]';
     
    214229    say '           Processing stops (rc=0) on the first locked directory.';
    215230    say '           <tag> is a name of the lock.';
     231    say '   -s      Skip locked directories in stead of stopping.'
    216232    exit(-1)
    217233
     
    234250    parse arg sTag
    235251    rc = stream('.dirlocked' || sTag, 'c', 'close');
    236     call SysFileDelete '.dirlocked';
     252    call SysFileDelete '.dirlocked' || sTag;
    237253    return 0;
    238254
Note: See TracChangeset for help on using the changeset viewer.