home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 28 Fixes4x
/
28-Fixes4x.zip
/
hpfsfp10.zip
/
dirfix.cmd
next >
Wrap
OS/2 REXX Batch file
|
1999-09-06
|
2KB
|
87 lines
/*
dirfix.cmd - reset archive attribute on directories
Copyright 1999 by Chuck McKinnis, Sandia Park, NM (USA)
mckinnis@ibm.net
*/
Trace 'N'
Parse Upper Arg drives test .
If drives = 'TEST' Then
Parse Upper Arg test drives .
If Abbrev(test, 'TEST') Then
test = 1
Else
test = 0
If drives = '' Then
Do
Say 'Report on and reset directory entries'
Say ' that have the archive bit set on'
Say ''
Say 'Usage - dirfix x: | all [test]'
Say ' test - just report the findings'
Return
End
Call Setup
If drives = 'ALL' Then
drives = SysDriveMap(, 'LOCAL')
Else
If Lastpos(':', drives) <> Length(drives) Then
drives = drives || ':'
tst_attrib = '++***'
chg_attrib = '-****'
if test Then
chg_attrib = '*****'
Do i = 1 To Words(drives)
Parse Value SysDriveInfo(Word(drives, i)) With drive free total .
If free = total | free = '' | free = 0 Then
Iterate i
drive = drive || '\'
rc = SysFileTree(drive, 'dirs.', 'DSO', tst_attrib, chg_attrib)
If dirs.0 > 0 Then
Do i = 1 To dirs.0
Say 'Archive bit set on in' dirs.i
End
Else
Say 'No archive bits found set in directories on' drive
If \test Then
Do
If dirs.0 = 1 Then
Say dirs.0 'directory cleared on' drive
Else
Say dirs.0 'directories cleared on' drive
End
End
Call Cleanup
Return
Cleanup:
Procedure Expose sysfuncs.
Do i = 1 To sysfuncs.0
If sysfuncs.i <> '' Then
Call RxFuncDrop(sysfuncs.i)
End
Return
Setup:
Procedure Expose sysfuncs.
sysfuncs.1 = 'SysFileTree'
sysfuncs.2 = 'SysDriveMap'
sysfuncs.3 = 'SysDriveInfo'
sysfuncs.0 = 3
Do i = 1 To sysfuncs.0
If RxFuncQuery(sysfuncs.i) Then
Call RxFuncAdd sysfuncs.i, 'RexxUtil', sysfuncs.i
Else
sysfuncs.i = ''
End
Return