![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Why this program hangs at last read. include dm,bp,unix.h fcntl.h FD = %open("/u2/tmp/floppy",O$RDONLY) if FD < 0 then crt "Error ":system(0) stop end loop Buffer=SPACE(210) Ret=%rdhex(FD,Buffer,100) IF Ret<0 THEN EXit crt ret, Buffer[1,Ret] repeat %close(FD) end Also can't understood documentation. In reality size is nHexChars == 2*BytesInFile n = %RDHEX( file.descriptor, variable, size ) Description: reads the number of bytes designated by "size" into "variable" from the file specified by "file.descriptor" returned by a previous call to "%open()", "%creat()" or "dup()" converting each byte into two ASCII hexadecimal characters. A string of a size at least equal to 2 * "size" must have been assigned to "variable" before the call by either an explicit assignment (e.g. buffer=space(1000)) or by the "char" reserve statement, otherwise data will be truncated. The function returns the number of bytes actually read or "-1" if an error occurred. If less than 2 * "size" bytes are returned, the content of the string beyond is undefined, as is usual in C. This function is the opposite of "%whex()". !!!!! A string of a size at least equal to 2 * "size !!!!! The function returns the number of bytes actually read Many thanks. Regards, Grigory |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hello Peter, Thanks for information. Is it right: 1 Will fixed in version 7.5 for Linux 2 Documentation is wrong. Regards, Grigory |
![]() |
| Thread Tools | |
| Display Modes | |
| |