Mail Archives: opendos/1997/03/18/01:09:01
Colin W. Glenn wrote:
>
> Will sort return an error code if the file is larger than free memory or
> 64K? Then I could use that and either:
>
> sort success: kill oldname
> rename newname (to) oldname
> sort fail: kill newname
I couldn't find any documented exit codes for SORT in what I have within
reach, but I tried the following at the DOS prompt with a 63KB
filename.ext and a 126KB filename.ext:
sort < filename.ext > filename.srt
if errorlevel 2 echo 2
if errorlevel 1 echo 1
if errorlevel 0 echo 0
63KB filename.ext returned 0
126KB filename.ext returned 1
Be sure to test this thoroughly before relying on it, and try to find
out if sort exit codes are documented anywhere.
Jeff Harlow
- Raw text -