[comp.os.msdos.programmer] turbo pascal 5.0 SetFAttr ...

eduardo@m2xenix.psg.com (Eduardo Salom) (08/15/90)

>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 |