🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Marek Brudka (A. Pacut) Tue, 02 Apr 1996 18:59
struct stat.st_type in Watcom C/C++ v9.5 for QNX
#3
Author: Marek Brudka (A. Pacut)
Date: Tue, 02 Apr 1996 18:59
13 lines
1150 bytes
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?
 
					Thanks
					Marek Brudka
					brudka@ia.pw.edu.pl
Re: struct stat.st_type in Watcom C/C++ v9.5 for QNX
#4
Author: 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
-----------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads