请问如何去掉文件的只读属性?
例:
  istpath:='c:\temp\';
  istfile:='c:\temp\istmchdata.mdb';
  ForceDirectories(istpath);
  DeleteFile(istfile);
  CopyFile(pchar(getcurrentdir+'\date\data.mdb'),pchar(istfile),true);因为是从光盘读取的!想把只读属性去掉!

解决方案 »

  1.   

    setfileattributes(pchar('d:\ks\txt.rar'),FILE_ATTRIBUTE_normal););
      

  2.   

    对,用API函数SetFileAttributes!具体内容看看SDK Help
      

  3.   

    procedure fileattr(filename:string);
      var
        attr:word;
      begin
        attr:=filegetattr(filename);
        attr:=attr and (not fareadonly);
        filesetattr(filename,attr);
      end;这个应该可以的。
      

  4.   

    function FileSetAttr(const FileName: string; Attr: Integer): Integer;
      

  5.   

    function FileSetReadOnly(const FileName: string; ReadOnly: Boolean): Boolean;