hi. its been a while since i last posted, i've resumed some
work i have been doing a while ago. the program i am
planning to write relies heavily on redirection (> and < in
dos) and piping (using the | character in dos). when
retrieving data from another command via the special "|"
character in dos, a program has to read from file handle
0 (that's stdin), i thought. so i wrote a test program:
when i enter this command line in a win95 dosbox:
c:\>type 2kb_file.txt | mytest.com
the text file is 2 kilobytes and the output from
the mytest.com program is "2048". perfect it works.
when i do the same under win2k it outputs "512".
when the file is smaller than 512 bytes it outputs the
correct amount of bytes.
is this a limitation/bug/rule(?) under win2k??
can it only handle files that are <= 512 bytes??
i hope anyone knows, thanx.
work i have been doing a while ago. the program i am
planning to write relies heavily on redirection (> and < in
dos) and piping (using the | character in dos). when
retrieving data from another command via the special "|"
character in dos, a program has to read from file handle
0 (that's stdin), i thought. so i wrote a test program:
Code:
cseg segment para public
org 100h
main proc near
mov ax,3F00h ;file read function.
xor bx,bx ;file handle 0 stdin.
mov cx,0FFFFh ;read in 64k. although it never will.
mov dx,1000h ;put data in current segment at 4096.
int 21h
call disp_ax ;display bytes read in decimal on screen.
int 20h
main endp
; ---------------------------------------------------
disp_ax proc near
mov bx,10
xor cx,cx
lp0:
xor dx,dx
div bx
add dx,30h
push dx
inc cx
cmp ax,0
jnz lp0
mov ah,2
lp1:
pop dx
int 21h
loop lp1
ret
disp_ax endp
cseg ends
end main
when i enter this command line in a win95 dosbox:
c:\>type 2kb_file.txt | mytest.com
the text file is 2 kilobytes and the output from
the mytest.com program is "2048". perfect it works.
when i do the same under win2k it outputs "512".
when the file is smaller than 512 bytes it outputs the
correct amount of bytes.
is this a limitation/bug/rule(?) under win2k??
can it only handle files that are <= 512 bytes??
i hope anyone knows, thanx.