home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / kcss0012.zip / SAMPLES / FILE / FILES.CSS
Cascading Style Sheet File  |  1998-02-09  |  1KB  |  34 lines

  1. /*  Copyright (c) 1998 IBK-Landquart-Switzerland. All rights reserved.
  2.  *
  3.  *  Module      :  Files.css
  4.  *  Application :  Sample for several file functions in context
  5.  *  Author      :  Peter Koch, IBK
  6.  *
  7.  *  Date        Description                                 Who
  8.  *  --------------------------------------------------------------------------
  9.  *  Feb 1998    First release                               P.Koch, IBK
  10.  */
  11. #loadLibrary 'KcSysLib'
  12. #loadLibrary 'KcFileLb'
  13.  
  14. main()
  15. {
  16.   if (sizeof(mainArgVals) < 3)
  17.     throw '%%% usage: css files <filemask>';
  18.  
  19.   var a = 2, tmp = fileTempName();
  20.   var rc = sysCommand('dir '+mainArgVals[a]+' /B >'+tmp+' 2>nul');
  21.   if (rc)
  22.     throw '%%% system error ('+rc+') querying file list';
  23.   var fh = fileOpen(tmp, fileOpenRead), cnt = 0;
  24.   while (!fileEof(fh)) {
  25.     var file = fileReadLine(fh);
  26.     if (file != '')
  27.       sysLog('file #' + ++cnt + ': ' + file);
  28.   }
  29.   sysLog();
  30.   sysLog('total '+cnt+' file(s)');
  31.   fileClose(fh);
  32.   fileDelete(tmp);
  33. }
  34.