Changeset 5718 for trunk/tools


Ignore:
Timestamp:
May 16, 2001, 3:17:03 AM (24 years ago)
Author:
bird
Message:

Added fix for '.' and '..'.

File:
1 edited

Legend:

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

    r3054 r5718  
    1 /* $Id: Exists.cmd,v 1.1 2000-03-09 17:23:23 bird Exp $
     1/* $Id: Exists.cmd,v 1.2 2001-05-16 01:17:03 bird Exp $
    22 *
    3  * Simple rexx util which checks if an file exists.
     3 * Simple rexx util which checks if a file or directory exists.
    44 *
    55 * Syntax: exists.cmd <filename>
    66 * Return code: 0 - file exists
    7  *              1 - file don't exist.
     7 *              1 - file doesn't exist.
    88 *
    9  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     9 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    1010 *
    1111 * Project Odin Software License can be found in LICENSE.TXT
     
    1414    parse arg sFile
    1515
     16    if (sFile = '.' | sFile = '..') then
     17        exit(0);
     18
    1619    if (stream(sFile, 'c', 'query exists') = '') then
     20    do  /* directory ? */
     21        if (RxFuncQuery('SysFileTree') = 1) then
     22            call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree';
     23        rc = SysFileTree(sFile, sDirs, 'DO');
     24        if (rc = 0 & sDirs.0 = 1) then
     25            exit(0);
    1726        exit(1);
     27    end
    1828    exit(0);
    1929
Note: See TracChangeset for help on using the changeset viewer.