delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/1997/03/18/01:09:01

Message-ID: <332E2C5D.12AE@ibm.net>
Date: Mon, 17 Mar 1997 23:47:09 -0600
From: Jeff Harlow <jharlow AT ibm DOT net>
Reply-To: jharlow AT ibm DOT net
Organization: none
MIME-Version: 1.0
To: opendos AT mail DOT tacoma DOT net
Subject: Re: [opendos] Wishlist v2.0
References: <Pine DOT GSO DOT 3 DOT 95 DOT 970316133312 DOT 27805B-100000 AT sparkie DOT gnofn DOT org>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019