🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.qnx
Article #4

Re: struct stat.st_type in Watcom C/C++ v9.5 for QNX

#4
From: Lawrence Kirby
Date: Wed, 03 Apr 1996 23:19
25 lines
1742 bytes
In article <3161791B.5D8F@ia.pw.edu.pl> brudka@ia.pw.edu.pl "A. Pacut" writes:

>Hi,
>According to the "WATCOM C LIBRARY REFERENCE FOR QNX" the structure stat
>in sys/stat.h should contain the field _ftype_t st_type that allows to
>identify the type of given file i.e if it is fifo, regular, directory
>etc. Unfortunatelly there is no st_type in this structure. Moreover
>there is no field of _ftype_t in the structure stat that makes me able
>to recognize the file (althought the field st_spare0 is the appropriate
>type, its values are usually useless). Could anybody tell me then what
>is the way of checking the type of a file?

Standard C doesn't support file types and doesn't define a struct stat.
POSIX does and the information is held in the st_mode member. POSIX also
defines S_ISDIR(), S_ISCHR(), S_ISBLK(), S_ISREG(), S_ISFIFO() macros
for testing an st_mode value.

I've removed comp.lang.c and comp.lang.c++ from the followups and added
comp.unix.programmer.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID: <828573542snz@genesis.demon.co.uk>
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!genesis.demon.co.uk
References: <3161791B.5D8F@ia.pw.edu.pl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!genesis.demon.co.uk
From: Lawrence Kirby <fred@genesis.demon.co.uk>
Newsgroups: comp.os.qnx,comp.lang.c++,comp.lang.c
Subject: Re: struct stat.st_type in Watcom C/C++ v9.5 for QNX
Followup-To: comp.os.qnx,comp.unix.programmer
Date: Wed, 03 Apr 96 23:19:02 GMT
Organization: none
Message-ID: <828573542snz@genesis.demon.co.uk>
References: <3161791B.5D8F@ia.pw.edu.pl>
Reply-To: fred@genesis.demon.co.uk
X-NNTP-Posting-Host: genesis.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.27
X-Mail2News-Path: genesis.demon.co.uk