当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·cad类型    »显示摘要«
    摘要: pb6.5中用ole_control.insertclass()可以改变控件类型, 如ole_control.insertclass("autocad.drawing")表示将ole类型变为autocad, 那么其它常用cad类型及软件如word,access,excel,txt,pdf又如何写呢? 多多益善,谢谢! ......
 ·listbox的编辑问题    »显示摘要«
    摘要: 在按f2键的时候,能不能像listview一样进入可编辑状态? ......


在c中,如何删去文件

不调用system函数,如何删去文件?  
  解决者加分!  
  例如:copy   old.bin   to   new.bin,   then   delete   old.bin  
  Delete()  
  {  
            open   file   "old.bin"  
            read   content   to   buffer.  
            create   the   new   file   "new.bin".  
            write   the   content   of   buffer   to   the   new   file.  
            delete   the   old   file.           //how   to   do   this  
  }

NO.1   作者: fangrk

Header   File  
  stdio.h    
   
  Category  
  Input/output   Routines  
   
  Syntax  
   
  #include   <stdio.h>  
  int   remove(const   char   *filename);  
  int   _wremove(const   wchar_t   *filename);  
   
  Description  
  Removes   a   file.  
   
  remove   deletes   the   file   specified   by   filename.   It   is   a   macro   that   simply   translates   its   call   to   a   call   to   unlink.   If   your   file   is   open,   be   sure   to   close   it   before   removing   it.  
   
  The   filename   string   can   include   a   full   path.  
   
  Return   Value  
  On   successful   completion,   remove   returns   0.   On   error,   it   returns   -1,   and   the   global   variable   errno   is   set   to   one   of   the   following   values:  
   
  EACCES Permission   denied  
  ENOENT No   such   file   or   directory

NO.2   作者: sun_srh

函数名:   remove    
  功     能:   删除一个文件    
  用     法:   int   remove(char   *filename);    
  程序例:    
   
  #include   <stdio.h>    
   
  int   main(void)    
  {    
        char   file[80];    
   
        /*   prompt   for   file   name   to   delete   */    
        printf("File   to   delete:   ");    
        gets(file);    
   
        /*   delete   the   file   */    
        if   (remove(file)   ==   0)    
              printf("Removed   %s.\n",file);    
        else    
              perror("remove");    
   
        return   0;    
  }    
   
 


    摘要: 在使用intouch配置模拟标记名报警条件时,主副偏差的产生是不是与检测设备相关的呢?(换句话说:同一个测量点,如果检测设备更换了,各种偏差是不是随设备变化:) 也就是说:最小工程单位、最大工程单位是设备相关的么? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE