home *** CD-ROM | disk | FTP | other *** search
- *REM This batch file is Freeware, free to use and redistribute unmodified *
- *REM Jouni Miettunen * jon@stekt.oulu.fi * Oulu * Finland * Europe * 1992 *
-
- REM Check free disk space (unixish df DiskFree)
- REM Timestamp 15-Nov-1992
-
- setlocal^break on^unalias *^if "%1"=="-?" goto info
-
- REM Did the user give any arguments?
- if "%@ascii[%1]" != "45" goto over
-
- :optiot
- set index=%@eval[%index+1]^set %@ascii[%@substr[%1,%index,1]]=1
- if %index lt %@eval[%@len[%1]-1] goto optiot^shift
-
- iff "%[%@ascii[a]]"=="1" then^set try=65^goto scan^endiff
-
- REM Check only some drives
- REM Note: the FOR's ending parenthesis can't be last character of previous line.
- REM If it was and we used df without arguments, we would not "goto end", only
- REM quietly quit and leave break on. RTFM did not help. 4DOS 4.01 revision D.
-
- :over
- iff %#==0 then^echos Drive %@upper[%_disk]:^free|find "es f"
- else^for %a in (%&) (
- iff %@ready[%@substr[%a,,1]:]==1 then^echos Drive %@upper[%@substr[%a,,1]]:
- free %@substr[%a,,1]:|find "es f"^endiff
- )
- endiff^goto end
-
- REM Check all available drives
-
- :scan
- iff %@ready[%@char[%try]:]==1 then
- echos Drive %@upper[%@char[%try]]:^free %@char[%try]:|find "es f"^endiff
- set try=%@eval[%try+1]^if %try gt %@ascii[%_lastdisk] goto end
- goto scan
-
- :info
- echo Usage: %@lower[%@name[%0]] [-option] drives
- text
-
- -a check all available drives
- -? info
- endtext
-
- :end
- break off^quit
-