C
[email protected]
Guest
Hi,
I am not gettign the correct output fro mthe following snippet:
========================================================set fn=C:\Charles_Docs\00035212.jpg
set fh=%@fileopen[%fn,read,b]
iff %fh == -1 then
echo file could not be opened
else
setdos /x-12456789
:: 1 All alias expansion
:: 2 Nested alias expansion only
:: 3 All variable expansion (includes environment variables, batch file parameters, variable
:: function evaluation, and alias parameters)
:: 4 Nested variable expansion only
:: 5 Multiple commands, conditional commands, and piping (affects the command separator, ||,
:: &&, |, and |&)
:: 6 Redirection (affects < , >, >&, >&>, etc.)
:: 7 Quoting (affects back-quotes [`] and double quotes ["]) and square brackets)
:: 8 Escape character
:: 9 Include lists
set nRes=%@FILESEEK[%fh,0,0]
iff %nRes == -1 then
echo File not Seeked: %nRes
else
set tst=%@fileread[%fh,12]
set nLen=%@len[%tst]
echo Read %nLen bytes....
:: returns "Read 4 bytes" - not 12
set fc=%@fileclose[%fh]
iff %fc == -1 then
echo File not closed...
endiff
endiff
setdos /x0
endiff
unset fn, fh, nRes, tst, fc
========================================================
I am not gettign the correct output fro mthe following snippet:
========================================================set fn=C:\Charles_Docs\00035212.jpg
set fh=%@fileopen[%fn,read,b]
iff %fh == -1 then
echo file could not be opened
else
setdos /x-12456789
:: 1 All alias expansion
:: 2 Nested alias expansion only
:: 3 All variable expansion (includes environment variables, batch file parameters, variable
:: function evaluation, and alias parameters)
:: 4 Nested variable expansion only
:: 5 Multiple commands, conditional commands, and piping (affects the command separator, ||,
:: &&, |, and |&)
:: 6 Redirection (affects < , >, >&, >&>, etc.)
:: 7 Quoting (affects back-quotes [`] and double quotes ["]) and square brackets)
:: 8 Escape character
:: 9 Include lists
set nRes=%@FILESEEK[%fh,0,0]
iff %nRes == -1 then
echo File not Seeked: %nRes
else
set tst=%@fileread[%fh,12]
set nLen=%@len[%tst]
echo Read %nLen bytes....
:: returns "Read 4 bytes" - not 12
set fc=%@fileclose[%fh]
iff %fc == -1 then
echo File not closed...
endiff
endiff
setdos /x0
endiff
unset fn, fh, nRes, tst, fc
========================================================