Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!rh2y+ From: rh2y+@andrew.cmu.edu (Russell E. Hoffman, II) Newsgroups: comp.os.os9 Subject: Need help w/directories under C Message-ID: <0bOkkiu00WB6QLT0M4@andrew.cmu.edu> Date: 16 Dec 90 05:54:54 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 18 I am writing a utility program in C, and part of it requires grabbing the directory stuff for a particular file (i.e. the size of the file, date of creation, etc.) I am presently using the opendir() and readdir() routines to read in the filenames, and then i do an open() on an individual file to get a path to it, then a _gs_gfd() to get its file descriptor. This works fine, unless the particular file happens to itself be a directory. In this case, _gs_gfd() returns -1, an error. How can I tell if a file is a directory or not? I was hoping that _gs_gfd() would be of use, by reading the file descriptor and then getting its attribute byte, but obviously this is not going to work. Any hints? Thanks in advance, Russell Hoffman rh2y+@andrew.cmu.edu Carnegie Mellon University