Article View: comp.sys.atari.st
Article #25202Re: Problems with Fattrib on a directory
From: gert
Date: Fri, 20 Feb 1987 08:24
Date: Fri, 20 Feb 1987 08:24
45 lines
1478 bytes
1478 bytes
In article <8702170915.AA29778@jade.berkeley.edu> UDAC041%UK.AC.KCL.CC.VAXA@ac.uk writes:
>Subject: Fattrib problems reading directories
>
>
>Hi,
>
>I have been using 'Fattrib' gemdos function to read the attributes of a
>directory but all it returns is 0 without bit 0x10 set to indicate that
>it is a directory.
>
>Am I doing something wrong ? Or isn't supposed to give the attributes of a
>directory ?
>
>I get the correect results for files (ie. read only).
>
>Can any one help ?
>
>Thanks in advance,
>
>Andrew Smith.
Try this:
mode ( name )
char *name;
{
struct DTA myDta, *oldDta;
oldDta = (struct DTA *)Fgetdta();
Fsetdta ( myDta );
if (( errno = Fsfirst ( name, -1 ) < 0 ))
return ( -1 ); /* this can never be a valid mode */
Fsetdta ( oldDta );
return ( myDta.attr );
}
Succes...
Gert Poletiek
Dutch National Institute for High Energy Physics
Technical Details
Message-ID:
<252@nikhefh.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!mcvax!nikhefh!gertReferences:
<8702170915.AA29778@jade.berkeley.edu>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!mcvax!nikhefh!gert From: gert@nikhefh.UUCP Newsgroups: comp.sys.atari.st Subject: Re: Problems with Fattrib on a directory Message-ID: <252@nikhefh.UUCP> Date: Fri, 20-Feb-87 03:24:18 EST Article-I.D.: nikhefh.252 Posted: Fri Feb 20 03:24:18 1987 Date-Received: Sun, 22-Feb-87 01:45:46 EST References: <8702170915.AA29778@jade.berkeley.edu> Reply-To: gert@nikhefh.UUCP (Gert Poletiek) Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 45