Aug 30, 2000 #1 roboz MIS Mar 25, 1999 8 AU Is there a way of toggling the file Read-only and Hidden attributes from within the software using Borland C++ Builder? Thanks
Is there a way of toggling the file Read-only and Hidden attributes from within the software using Borland C++ Builder? Thanks
Aug 31, 2000 #2 2ffat Programmer Oct 23, 1998 4,811 US roboz, [tab]Check out access and chmod in io.h. access allows you to determine the file attributes while chmod allows you to change them. Upvote 0 Downvote
roboz, [tab]Check out access and chmod in io.h. access allows you to determine the file attributes while chmod allows you to change them.
Sep 4, 2000 #3 Pcmedic Programmer May 25, 2000 3 GB use 3 checkboxes and an edit box on a form plus get and set buttons. void __fastcall TForm1::GetAttrClick(TObject *Sender) { int val; val = FileGetAttr(Edit1->Text); if (val & faReadOnly) rCheck->Checked = true; else rCheck->Checked = false; if (val & faHidden) hCheck->Checked = true; else hCheck->Checked = false; if (val & faSysFile) sCheck->Checked = true; else sCheck->Checked = false; } //--------------------------------------------------------------------------- void __fastcall TForm1::SetAttrClick(TObject *Sender) { int val= 0; if(rCheck->Checked) val = val + 1; if(hCheck->Checked) val = val + 2; if(sCheck->Checked) val = val + 4; FileSetAttr(Edit1->Text,val); } Upvote 0 Downvote
use 3 checkboxes and an edit box on a form plus get and set buttons. void __fastcall TForm1::GetAttrClick(TObject *Sender) { int val; val = FileGetAttr(Edit1->Text); if (val & faReadOnly) rCheck->Checked = true; else rCheck->Checked = false; if (val & faHidden) hCheck->Checked = true; else hCheck->Checked = false; if (val & faSysFile) sCheck->Checked = true; else sCheck->Checked = false; } //--------------------------------------------------------------------------- void __fastcall TForm1::SetAttrClick(TObject *Sender) { int val= 0; if(rCheck->Checked) val = val + 1; if(hCheck->Checked) val = val + 2; if(sCheck->Checked) val = val + 4; FileSetAttr(Edit1->Text,val); }