Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!sdd.hp.com!wuarchive!mit-eddie!media-lab!lenox From: lenox@media-lab.MEDIA.MIT.EDU (Lenox H. Brassell) Newsgroups: comp.os.os2.programmer Subject: Re: Dectection of HPFS File system? Summary: and better yet (no write access needed) Message-ID: <4114@media-lab.MEDIA.MIT.EDU> Date: 19 Nov 90 20:45:37 GMT References: <15510005@hpspcoi.HP.COM> <11686@hubcap.clemson.edu> <4112@media-lab.MEDIA.MIT.EDU> Organization: MIT Media Lab, Cambridge, MA Lines: 27 This method is better yet: it does not require write access to the device in order to work. (It does require read access: I haven't found any way around that!) Just be sure that you mark the EXE header of the program that uses this test to be "longfilename-aware": int IsFAT (char chDriveName) { char szFileSpec[] = "*:123456789"; HDIR hdir = HDIR_CREATE; USHORT usAttribute = FILE_NORMAL; USHORT usSearchCount = 1; FILEFINDBUF findbuf; USHORT cbBuf; USHORT usCode; szFileSpec[0] = chDriveName; usCode = DosFindFirst (szFileSpec, &hdir, usAttribute, &findbuf, (USHORT)sizeof(findbuf), &usSearchCount, 0L ); if (usCode == 0) DosFindClose (hdir); return usCode == ERROR_FILENAME_EXCED_RANGE; }