这几天看到了fopen的参数设置。中文的那些真的是不能帮助精确理解。在网上发现了英文的,特附上: FILE *fopen(const char *filename, const char *mode)fopen opens the named file, and returns a stream, 
                            
                            
                                分类:
其他好文   时间:
2016-02-17 22:12:57   
                                阅读次数:
328
                             
                    
                        
                            
                            
                                最近服务器上一个后台传输文件的服务,经常会报出异常来,只能强行终止并重启。 昨天刚好有空,现场抓了一下dump,再把程序扔到IDA里看了一下,很快就找出原因了,原来是调用fclose时出错的。 使用C的Runtime函数进行文件操作,也就是fopen,fread,ftell,fclose这些,本身这
                            
                            
                                分类:
其他好文   时间:
2016-02-14 12:59:38   
                                阅读次数:
196
                             
                    
                        
                            
                            
                                web端: [php] view plain copy print? <?php $c = $GLOBALS['HTTP_RAW_POST_DATA']; $n = $_GET["filename"]; $fp = fopen($n,'w+'); fwrite($fp, $c, strlen($c)
                            
                            
                                分类:
Web程序   时间:
2016-02-08 21:17:50   
                                阅读次数:
1189
                             
                    
                        
                            
                            
                                <?php header("content-type:text/html;charset=utf-8"); $fp = fopen("lock.txt","w+"); if(flock($fp, LOCK_EX)){// 进行排它型锁定 fwrite($fp,"Write something her
                            
                            
                                分类:
编程语言   时间:
2016-02-01 18:15:02   
                                阅读次数:
145
                             
                    
                        
                            
                            
                                为什么要使用setvbuf函数 如果你的内存足够大,可以把文件IO的BUF设置大一些,这样每次你用fopen/fread/fwrite/fscanf/fprintf语句的时候,都会在内存里操作,减少内存到磁盘IO读写的操作次数,提高系统效率。如果你的程序的功能涉及到类似数据库、视频、音频、图像处理等
                            
                            
                                分类:
其他好文   时间:
2016-01-30 02:08:36   
                                阅读次数:
281
                             
                    
                        
                            
                            
                                size_tfread(void* buff,size_t size,size_t count,FILE* stream)参数1:读取到该buff所指向的内存空间中参数2:每次读取的字节数,单位是字节(单个元素的大小)(单字节数)参数3:读取的次数(元素的个数)(数据项的个数)参数4:目标文件指针返...
                            
                            
                                分类:
其他好文   时间:
2016-01-26 18:10:46   
                                阅读次数:
176
                             
                    
                        
                            
                            
                                1 function writelog($str)2 {3 $open=fopen("e:\log.txt","a" );4 fwrite($open,$str);5 fclose($open);6 }View Code1. 使...
                            
                            
                                分类:
Web程序   时间:
2016-01-15 12:32:44   
                                阅读次数:
182
                             
                    
                        
                            
                            
                                一:file_get_contents(filename) 和file_put_contents(filename, data) 1 二:fopen(filename, mode) fwrite(handle, string) fclose(handle) 1 三:文件读取的几种方式(custom....
                            
                            
                                分类:
其他好文   时间:
2016-01-12 15:08:16   
                                阅读次数:
134
                             
                    
                        
                            
                            
                                文件:打开和关闭:fopen(), fclose()读:readfile(), file(), file_get_contents(), fgets(), fgetss(), fgetc()写:fwrite(), file_put_contents()//其他操作:rename(), copy(),...
                            
                            
                                分类:
Web程序   时间:
2015-12-30 19:17:07   
                                阅读次数:
160
                             
                    
                        
                            
                            
                                其实,如果你学习过C语言的话,直接用 stdio.h中函数是最简单的,也就是使用 fopen( "xxxx.xxx", "rb" ); 然后再调用 fread/fwrite; 关闭时调用 fclose 就可以了。如果使用 Windows Native API 中的 CreateFile, 是不需要区...