[comp.os.msdos.programmer] problem with int 21,5D00

hartnegg@sun1.ruf.uni-freiburg.de (Klaus Hartnegg) (10/14/90)

Here's a hard problem for all who use MSDOS software interrupts:
(In the following "function xx" means doing an INT 021H with ah=0xxh)

I want to rename files across directories with function 56 but I want
do do it with wildcards.

Until now I used functions 4E and 4F do search all matching files and
called 56 for each file.

Now I noticed that Function AX=5D00 is intended to do this job
for me and can even do it MUCH faster because only ONE directory
access is neccesary. Until now one access per file is done.

But it always returns error code 5 (access denied) when I try to
move ALL files from one directory to another. I finally found
that the source is allowed to be "*.*" but not the destination.
Examples:
mv 1\*.dat 1\*.bak  ok
mv 1\*.dat 2\*.dat  ok
mv 1\*.dat 2\*.bak  ok
mv 1\*.*   2\*.dat  ok  (but renaming all files to ".dat"!)
mv 1\*.*   2\*.*    Access denied - nothing done
mv 1\*.dat 2\*.*    Access denied - nothing done


I'm using "IBM Personal Computer DOS-Version  3.30".
No I didn't forget to convert all filenames with function 60.
I set the 9th and 10th parameter of the DOS parameter list to 0
and the 11th to the PSP segment of the running program.
What else could be wrong?

I'll use this in my mv-utility that can move any number of files
and directories(!) from anywhere to everywhere. I expect it to get
enormous fast (any number of files within 1/10 sec!) when working
within one device. The first one who helps me solving this problem
will of course get a free copy.
-- 
---------------------------------------------------------------
Klaus Hartnegg, Kleist-Str. 7, D-7835 Teningen, Tel 07641/48652
BITNET   : HAKL@DFRRUF1
Internet : HAKL@ibm.ruf.uni-freiburg.de

hartnegg@sun1.ruf.uni-freiburg.de (Klaus Hartnegg) (10/18/90)

hartnegg@sun1.ruf.uni-freiburg.de (Klaus Hartnegg) writes:

>Now I noticed that Function AX=5D00 is intended to do this job
>for me and can even do it MUCH faster because only ONE directory
>access is neccesary. Until now one access per file is done.

>But it always returns error code 5 (access denied) when I try to
>move ALL files from one directory to another. I finally found
>that the source is allowed to be "*.*" but not the destination.
>Examples:
>mv 1\*.dat 1\*.bak  ok
>mv 1\*.dat 2\*.dat  ok
>mv 1\*.dat 2\*.bak  ok
>mv 1\*.*   2\*.dat  ok  (but renaming all files to ".dat"!)
>mv 1\*.*   2\*.*    Access denied - nothing done
>mv 1\*.dat 2\*.*    Access denied - nothing done

I got two suggestions to try
mv 1\*.* 2
mv 1\*.* 2\
but I'm afraid: it doesn't work. Instead I get the error "path not found".
What Msdos 5D00 does is expand the wildcards of the first name
to all matching files and then expand the wildcards of the second
name in a way that the corresponding part is taken from the first
name. So there have to be wildcards in the second name.

Any other suggestions? Is there nobody out there who has experience
with using this interrupt??
-- 
---------------------------------------------------------------
Klaus Hartnegg, Kleist-Str. 7, D-7835 Teningen, Tel 07641/48652
BITNET   : HAKL@DFRRUF1
Internet : HAKL@ibm.ruf.uni-freiburg.de