[Freedos-devel] libm-0.5

2023-06-13 Thread Gregory Pietsch
This is the latest version. I believe I have all the functions in libm 
implemented here, so please check my code and prove I do not suck. -- Gregory___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] EXIST NUL

2023-06-13 Thread jerome


> On Jun 13, 2023, at 4:02 PM, Jim Hall  wrote:
> 
> On Mon, Jun 12, 2023 at 4:05 PM Bret Johnson  wrote:
>> 
>> Rather than merely trying to copy the way MS did/does things regarding
>> IF EXIST X:NUL, I think we can discuss what the "right" way to handle
>> things should be.
> 
> We should still fix the FreeDOS behavior to match the MS-DOS behavior.

Issue #2 is simply a bug.

Issue #1 is a little different. Although Issue #1 matches the behavior of 
MS-DOS, it 
can be assumed to be a bug as well. Even Microsoft changed this to be 
consistent 
in Windows Command Shell at some point. 

> But if we're going to talk about the "right" way to do things, what
> about a new, separate "test" command to evaluate things?
> 
> I'm using Unix and Linux as a model, but not suggesting we emulate
> completely the features of Unix. But the Unix 'test' tool does some
> neat things. My suggestions for a "test" like command:
> 
> TEST /F file
> Returns errorlevel zero if the file exists, nonzero if not. This is like 
> doing:
> IF EXIST d:\path\file [..]
> ..but it puts the test on a separate line in the batch file, and you
> use the errorlevel afterwards to do your condition.
> 
> TEST /D dir
> Returns errorlevel zero if the dir exists, nonzero if not. This is like doing:
> IF EXIST d:\path\NUL [..]
> ..but it can be made more reliable.
> 
> 
> I think string tests are also useful:
> 
> 
> TEST /Z str
> Returns zero if the str is empty, nonzero if not. This is like doing:
> IF z%VAR%==z [..]
> ..but it makes the test more obvious.
> 
> TEST /S str
> Returns zero if the str is not empty, nonzero if empty. This is the
> opposite of "TEST /z str"
> 
> 
> Number value comparisons can also be a handy thing for some batch files:
> 
> 
> TEST /n n1 comp n2
> Test various comparisons on numbers. My nature is to use Fortran-like
> comparisons here, like:
> 
> TEST /n a LT b
> TEST /n a LE b
> Returns errorlevel zero if "a" is less than "b" (for LE, "less than or
> equal") nonzero if not
> 
> TEST /n a GT b
> TEST /n a GE b
> Returns errorlevel zero if "a" is greater than "b" (for GE, "greater
> than or equal") nonzero if not
> 
> TEST /n a EQ b
> Returns errorlevel zero if "a" is equal to "b", nonzero if not
> 
> TEST /n a NE b
> Returns errorlevel zero if "a" is not equal to "b", nonzero if not

I was going to wait until it was completely finished. But, there is no
harm in announcing it now.

I have already written a utility that does this and much more. It is part of 
V8Power Tools for DOS and called VTEST. It weighs in at under 3Kb. 
Because like all the programs in V8PT, it is written in assembly. 

It is capable of things like:

vtest 1234567890123 /gt -56789012345 
vtest /not hello /eq goodbye /and /d c:\ /and /not /f readme.txt
vtest 1 /lt 2 /lt 5 /gt 3 /and /not /c hello my friend /gt Goodbye /or /v 15
vtest  /f 00*.* /lt 005.txt 
vtest /not /f This text document.doc /and /not /f That text document.doc

It 64-bit numbers, long file names and even both case-specific and case-less 
string comparisons. 

All that is working great and it will be available for general testing sometime 
over the next few days. If I can spare a few minutes, possibly tomorrow.

If you are interested, the help text for VTEST can be viewed at:

https://github.com/shidel/fd-nls/blob/master/v8power/help/en/vtest.en 


Source is at:

https://github.com/LoopZ/V8Power/blob/master/SOURCE/VTEST.ASM 


Binary will be available soon.


Jerome

> 
> 
> ___
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel

___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] Logger

2023-06-13 Thread Jim Hall
On Fri, May 19, 2023 at 9:50 AM  wrote:
>
> Hi All,
>
> Logger is now out of BETA.
>
> Version 1.00 is now available.
>
> https://fd.lod.bz/repos/current/pkg-html/logger.html


I'm a month late on this, but THANKS for this very useful program!
I've just posted a note about it on the website.


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] EXIST NUL

2023-06-13 Thread Jose Senna
 Bret Johnson said:

 > The second questions is, "Does a device exist in
 > all existing directories, or only certain ones?"
 > The answer to that question is that it is supposed
 > to "exist" in ALL directories.

   I fully agree with the answer.
   I did not think this was a question, because the
  answer was so obvious,

 Jim Hall said:

 > We should still fix the FreeDOS behavior to match
 > the MS-DOS behavior.

   Shall this be an absolute rule, even when the
  behavior is a bug ?



___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] FreeDOS & LOGGER

2023-06-13 Thread Jim Hall
On Sat, Jun 10, 2023 at 9:31 AM Mercury Thirteen via Freedos-devel
 wrote:
>
> > Logger version 1.00 was released several weeks ago. That
> > should have been sufficient time those who are interested
> > in it to have a chance to try it out. I feel it is now
> > time to pose a few questions and get your opinions on
> > a couple things.
> >
> > Should a package for LOGGER be included on the FreeDOS
> > release media?
>
> Yes.

+1

I agree with Mercury that it's small and useful enough to be included.

> > If so, should LOGGER be installed with FULL or BASE? Or,
> > possibly just available as an EXTRA? (However, I
> > assume it should not automatically be started on an
> > installed system. Possibly, having a REM’ed line in
> > the FDCONFIG.SYS file.)
>
> Both. It's small (and useful!) enough to warrant the extra tiny bit
> of space used.

We've always defined "Base" to mean "the programs and commands that
replicate classic MS-DOS." So that means LOGGER should not go into
"Base" because LOGGER was not an original MS-DOS program. But putting
this in "Full" is fine.

> > Should LOGGER be included and possibly started
> > automatically when booting the FreeDOS USB or CD release
> > media?
>
> I could see developers opting to install it while most "average"
> users would likely forgo this, so I would say no to auto-start. Or,
> even better, let the installer leave the choice up to the user.

I agree; don't load LOGGER at boot time. This should be something
developers or other interested folks can do.

Since one use case for LOGGER is to help people debug their systems, I
think LOGGER should be something a user can uncomment to activate it.
So have it as a REM'd comment.


Jim


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] EXIST NUL

2023-06-13 Thread Jim Hall
On Mon, Jun 12, 2023 at 4:05 PM Bret Johnson  wrote:
>
> Rather than merely trying to copy the way MS did/does things regarding
> IF EXIST X:NUL, I think we can discuss what the "right" way to handle
> things should be.

We should still fix the FreeDOS behavior to match the MS-DOS behavior.
But if we're going to talk about the "right" way to do things, what
about a new, separate "test" command to evaluate things?

I'm using Unix and Linux as a model, but not suggesting we emulate
completely the features of Unix. But the Unix 'test' tool does some
neat things. My suggestions for a "test" like command:

TEST /F file
Returns errorlevel zero if the file exists, nonzero if not. This is like doing:
IF EXIST d:\path\file [..]
..but it puts the test on a separate line in the batch file, and you
use the errorlevel afterwards to do your condition.

TEST /D dir
Returns errorlevel zero if the dir exists, nonzero if not. This is like doing:
IF EXIST d:\path\NUL [..]
..but it can be made more reliable.


I think string tests are also useful:


TEST /Z str
Returns zero if the str is empty, nonzero if not. This is like doing:
IF z%VAR%==z [..]
..but it makes the test more obvious.

TEST /S str
Returns zero if the str is not empty, nonzero if empty. This is the
opposite of "TEST /z str"


Number value comparisons can also be a handy thing for some batch files:


TEST /n n1 comp n2
Test various comparisons on numbers. My nature is to use Fortran-like
comparisons here, like:

TEST /n a LT b
TEST /n a LE b
Returns errorlevel zero if "a" is less than "b" (for LE, "less than or
equal") nonzero if not

TEST /n a GT b
TEST /n a GE b
Returns errorlevel zero if "a" is greater than "b" (for GE, "greater
than or equal") nonzero if not

TEST /n a EQ b
Returns errorlevel zero if "a" is equal to "b", nonzero if not

TEST /n a NE b
Returns errorlevel zero if "a" is not equal to "b", nonzero if not


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] EXIST NUL

2023-06-13 Thread Bret Johnson
> It seems to me that te question is "Shall a device
> exist in a non-existing directory ?"

I don't think that's the correct question.  I think there are two questions.  
The first question is, "Does a device exist in a non-existent directory?"  The 
answer to that is no -- a device does not exist in an "imaginary" place that 
you cannot actually navigate to.  In that sense, it has the same 
characteristics as a "normal" file.

The second questions is, "Does a device exist in all existing directories, or 
only certain ones?"  The answer to that question is that it is supposed to 
"exist" in ALL directories.  If you can navigate to a directory, ALL devices 
"exist" there (at least for the purposes of an "IF EXIST" test).  For example, 
if you navigate to an existing directory on a floppy drive that's already full 
and has no room left for any "real" files, or a read-only device like a CD-ROM, 
the NUL device (and all other character devices) still "exist" there.  In 
addition, you can write to a character device (like NUL) even if the directory 
itself is read-only.  In that sense, it is different than a "normal" file.

That's why you can use the IF EXIST test (with a character device name in place 
of the file name) to test for the existence of a directory instead of a file, 
and it should work for any directory that is navigable.


___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


[Freedos-devel] EXIST NUL

2023-06-13 Thread Jose Senna
Bret Johnson said:

> Rather than merely trying to copy the way MS did/does
> things regarding IF EXIST X:NUL, I think we can discuss
> what the "right" way to handle things should be.

 It seems to me that te question is "Shall a device
 exist in a non-existing directory ?"




___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel