ChinaUnix.net
相关文章推荐:

vcs fread

vcs手册

by jollyfu - Solaris - 2006-07-07 09:28:58 阅读(414) 回复(0)

相关讨论

如何用fread fwrite复制一个文件? fread读到文件末尾时候,返回0;该如何知道实际读了多少数据? 谢谢 [code] int main( int argc, char *argv[] ) { int i, len; int rfd, wfd; char *buf; FILE *rfp, *wfp; len = atoi( argv[3] ); printf( "%d\n", len ); buf = (char*)alloca( len ); rfp = fopen( argv[1], "rb" ); wfp = fopen( argv[2], "w...

by jack9981 - C/C++ - 2007-05-17 12:42:42 阅读(1795) 回复(4)

这几天写了一个小程序,就是用fwrite把一个结构写到一个文件里面,然后用fread去读 并打印出来, 具体是这样的,这只是读取的那部分程序片段。 写入文件的只有一句话fwrite(tst,sizeof(teset),1,fp) struct test { int a; int b; int c; }tst; while (!feof(fp)) { fread(tst,sizeof(test),1,fp); printf("%d%d%d\n",tst.a,tst.b,tst.c); } 结果打印了两遍,郁闷中,恳求帮助。不胜感激。

by liqxy - C/C++ - 2011-11-25 09:04:25 阅读(2830) 回复(10)

请问一下: [code] while ( ( iRet = fread( cBuf,1,sizeof(cBuf),fp) ) >; 0 ) { ............. } [/code] fp=fopen("test","rb") fp=fopen("2","rb") sed -e 's/$/G/g' test >; 2 为什么test.txt可以完整的读出来,而2读出来有最后一个sizeof(cBuf) 读不出来?谢谢!

by tyffly - C/C++ - 2003-12-12 22:28:40 阅读(907) 回复(6)

将本地的几个文件上传到服务器上, 不知道可以用什么办法? 我想到的是用先将几个文件打包,然后fread 可是现在有个问题是,fread读取文本文件是可以的, 我用tar打包后,使用fread,上传到服务器上的文件都是0字节的空文件 不知fread函数对读取文件的格式有什么要求? 有什么方法可以解决吗? 谢谢?  72 fp = fopen(file, "r");//如果此处file为文本文件,读取就没有问题,如果是tar包,就会上传空的文件上去 &nbs...

by WHITLACK - C/C++ - 2009-03-05 12:57:50 阅读(10284) 回复(27)

[code]#include int main(int argc , char *argv[]) { int nRet; char buff[1024]; bzero(buff , sizeof(buff)); FILE *pt = fopen(argv[1] , "r+"); if(NULL == pt) { perror("fopen is error"); exit (0); } while(1) { nRet = fread(buff , sizeof(char) , sizeof(buff) , pt); std::cout<<"fread nRet = "<

by ruchong - C/C++ - 2007-07-03 17:28:09 阅读(1018) 回复(4)

在linux 环境下fread 如果执行成功那么返回值是什么? 在联机文档中说:执行正常时 返回值为正确读写的字节数。 可是我试的结果好像是 执行正常时 返回值为 1,看网上有些例子好像也是这么写的。 这是怎么回事? 我如何判断读操作正确执行了?

by jcs4989 - 程序开发 - 2006-10-10 15:03:53 阅读(1294) 回复(6)

是不是这两个函数不管文件以何种方式打开输出的都是二进制流?为什么以下两个程序输出无差别? #include #include /*本程序测试字节输出顺序,结果为先输出低位字节,后输出高位字节*/ void main() { unsigned int a=25185;/*a=98*256+97*/ FILE* fp; fp=fopen("a.txt","wb+"); //这改为“wt+"竟结果不变? if(fp==0){puts("error");exit(0);} fwrite(&a,sizeof(unsigned int),1,fp); f...

by beginer1 - C/C++ - 2005-12-08 23:47:57 阅读(2282) 回复(7)

fread出错,perror却打印出success,怎么搞的?

by 问路人 - C/C++ - 2005-12-02 11:57:43 阅读(642) 回复(5)

我真在谢谢一个小coding,巴数字放在两维数组里,然后把数组写在文件中,但是,当我读取的时候,我只能拿到第一行,别的拿不到,为什么? #include ; int main() { int row, col,i; int sum =0; FILE *my_stream; char my_filename[] = "my_numbers"; size_t object_size = sizeof(int); size_t object_count = 16; size_t op_return; int **tmp; tmp = (int **)malloc((4) * sizeof(int *)); for (i=0; i <=3; i++) tmp ...

by sandhurst - C/C++ - 2004-06-29 16:12:13 阅读(704) 回复(3)

vcs uses two components LLT and GAB to share data over private networks among systems. These components provide the performance and reliability required by vcs. LLT(Low Latency Transport) provides fast, kernel-to-kernel communications,and monitors network connections. The system administrator configures LLT by creating the configuration files /etc/llthosts, which lists all the system in the clus...

by zhshujun - 存储文档中心 - 2009-06-15 22:59:33 阅读(1097) 回复(0)