Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucsd!pacbell.com!pacbell!ditka!qiclab!m2xenix!eduardo From: eduardo@m2xenix.psg.com (Eduardo Salom) Newsgroups: comp.os.msdos.programmer Subject: turbo pascal 5.0 SetFAttr ... Message-ID: <1990Aug15.163605.12784@m2xenix.psg.com> Date: 15 Aug 90 16:36:05 GMT Organization: Pacific Systems Group, Portland Oregon US Lines: 26 >from: eduardo@m2xenix.psg.com (Eduardo Salom) Subject: turbo pascal 5.0 SetFAttr help.... in article <31924@eerie.acsu.Buffalo.EDU> lyda@sybil.cs.Buffalo.EDU (kevin lyda) says: > setfattr(f,directory); {hidden directory, no dos } > {error from getfattr } > writeln(log,doserror); {-??-> 5 } > > question: why is file access denied? when i hide an archive file i > can unhide it later, but not directories. is this a bug and more > importantly, is there a way i can hide AND unhide directories? The call to SetFAttr must have the directory bit off. Replace SetFAttr( f, directory ) by SetFAttr( f, $0 ) and the program will work. This is explained in the MS-DOS technical reference manual (CHMOD). I didn't know it but the question puzzled me enough to try several codes and finally ... up to read the manual. -- Eduardo J. Salom | eduardo@psg.com ..!uunet!m2xenix!eduardo SoftWare Plus SA | BIX: swp CIS: [73000,74] swp@dci2sp.das.net Larrea 1218 - 2.A | Delphi: swp VMS-Mail: PSI%07222211100717::SWP (1117) Buenos Aires, Argentina |