|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Reading documentation [code]void Main (void)
{
Int fd;
Char ch_buff[100];
Memset (ch_buff,0, sizeof (ch_buff));
Fd = open ( "info.txt", O_RDONLY);
If (fd ====== 1)
Printf ( "file open fail\n");
If (read (fd, ch_buff,11) ====== 1)
Printf ( "read error\n");
Printf ( "%s\n" ch_buff);
Close (fd);
}[/code]
Help me find,
Why not read a few lines of code above content of the document,
Length of 11 documents
Thank you, the ~ ~
|
Normal procedures ah friends, |
I also think it is quite normal, but I can not reproduce is to really strange |
[code]#include<stdio.h>
#include<unistd.h>
#include<string.h>
#include<fcntl.h>
Int main (void)
{
Int fd;
Char ch_buff[100];
Memset (ch_buff,0, sizeof (ch_buff));
Fd = open ( "info.txt", O_RDONLY);
If (fd ====== 1)
Printf ( "file open fail\n");
If (read (fd, ch_buff,11) ====== 1)
Printf ( "read error\n");
Printf ( "%s\n" ch_buff);
Close (fd);
Return 0
}
[/code]
Read |
| |