Changeset 1716
- Timestamp:
- Feb 15, 2014, 9:01:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/shdwmgr.cmd
r1192 r1716 2 2 * $Id$ 3 3 * 4 * ShdwMgr: Create Shadows for FM/2 installation */ 4 * ShdwMgr: Create Shadows for FM/2 installation 5 * 6 * 14 Feb 14 JBS Ticket 501: Corrected a syntax error and improved the error handling. 7 * Errors are now logged to a file. 5 8 * 6 9 */ … … 9 12 call SysLoadFuncs 10 13 11 parse upper arg package_parm .12 if strip(package_parm) == '' then13 package_parm = 'FM2'14 else15 if wordpos(package_parm, 'FM2 FM2UTILS') = 0 then16 do17 say 'Invalid parameter: 'arg(1)18 say 'Program aborted....'19 '@pause'20 exit 121 end22 23 14 parse source . . thispgm 24 15 thisdir = left(thispgm, lastpos('\', thispgm) - 1) … … 26 17 thisdir = thisdir || '\' 27 18 call directory thisdir 19 parse value filespec('N', thispgm) with program_stem '.' . 20 21 parse upper arg package_parm . 22 if strip(package_parm) == '' then 23 package_parm = 'FM2' 24 pkgnum = wordpos(package_parm, 'FM2 FM2UTILS') 25 26 error_log = program_stem || pkgnum || '.err' 27 call SysFileDelete error_log /* Delete previous error logs for this package */ 28 errors = 0 29 30 if pkgnum = 0 then 31 do 32 call lineout error_log, 'Invalid parameter:' package_parm 33 call lineout error_log, 'Program aborted....' 34 exit 1 35 end 28 36 29 37 i = 0 … … 61 69 if fullfilename = '' then 62 70 do 63 say 'Unable to find file: 'Shadow.i.filename 64 say 'thisdir: 'thisdir 65 '@pause' 66 exit 1 71 call lineout error_log, 'Unable to find file: 'Shadow.i.filename 72 errors = errors + 1 67 73 end 68 lenbytes = X2C( D2X( LENGTH( Shadow.i.longname ), 4 )) 69 rc = SysPutEA( fullfilename, '.LONGNAME', X2C('FDFF') || REVERSE( lenbytes ) || Shadow.i.longname ) 70 if rc \= 0 then 74 else 71 75 do 72 say 'Error in setting .LONGNAME EA: 'rc 73 say 'Exiting...' 74 '@pause' 75 exit 2 76 end 77 p = lastpos('\', Shadow.i.filename) 78 if p > 0 then 79 shadowidname = substr(Shadow.i.filename, p + 1) 80 else 81 shadowidname = Shadow.i.filename 82 rc = SysCreateObject( 'WPShadow', Shadow.i.longname, Shadow.i.folderid , 'SHADOWID='fullfilename';OBJECTID=<FM3_Shadow_'shadowidname'>;', 'R') 83 if rc \= 1 then 84 do 85 say 'Unable to create shadow object for :'Shadow.i.filename 86 say 'Exiting...' 87 '@pause' 88 exit 3 76 lenbytes = X2C( D2X( LENGTH( Shadow.i.longname ), 4 )) 77 rc = SysPutEA( fullfilename, '.LONGNAME', X2C('FDFF') || REVERSE( lenbytes ) || Shadow.i.longname ) 78 if rc \= 0 then 79 do 80 call lineout error_log, 'Error in setting .LONGNAME EA: 'rc 81 errors = errors + 1 82 end 83 84 p = lastpos('\', Shadow.i.filename) 85 if p > 0 then 86 shadowidname = substr(Shadow.i.filename, p + 1) 87 else 88 shadowidname = Shadow.i.filename 89 rc = SysCreateObject( 'WPShadow', Shadow.i.longname, Shadow.i.folderid , 'SHADOWID='fullfilename';OBJECTID=<FM3_Shadow_'shadowidname'>;', 'R') 90 if rc \= 1 then 91 do 92 call lineout error_log, 'Unable to create shadow object for :'Shadow.i.filename 93 errors = errors + 1 94 end 89 95 end 90 96 end 91 97 end 98 if errors > 0 then 99 do 100 call lineout error_log, errors 'errors encountered.' 101 call stream error_log, 'c', 'close' 102 end 92 103
Note:
See TracChangeset
for help on using the changeset viewer.