mgetstr — read a character string
str=mgetstr(n [,fd] )
a positive scalar: The number of character to read.
fd parameter returned by the
mopen. -1 stands for last opened file.
Default value is -1.
a character string
mgetstr function allows to read a character string in a binary file. If EOF is reached before read completion only the properly read values will be returned.
// open file descriptor as text with read mode fd_r = mopen(SCI+'/ACKNOWLEDGEMENTS','rt') // get 100 characters of fd_r strs_1 = mgetstr(100, fd_r) // get 200 next characters of fd_r strs_2 = mgetstr(200, fd_r) // close file descriptor mclose(fd_r);