Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!philmtl!philabs!gotham!east!camilla!dbaum From: dbaum@camilla.East.Sun.COM (Derek Baum - Sun PC Distributed Systems) Newsgroups: comp.os.os2 Subject: Re: DosFindFirst with HPFS names ? Message-ID: <1768@east.East.Sun.COM> Date: 9 Apr 90 17:31:37 GMT References: <90098.181854ARMENGAU@FRECP12.BITNET> Sender: news@east.East.Sun.COM Reply-To: dbaum@East.Sun.COM (Derek Baum - Sun PC Distributed Systems) Organization: Sun Microsystems, Billerica MA Lines: 28 In article <90098.181854ARMENGAU@FRECP12.BITNET> ARMENGAU@FRECP12.BITNET (Joel Armengaud) writes: >How can I get the long file names on an HPFS partition ? >When I use DosFindFirst, increasing the FILEFINDBUF structure, it doesn't >work... Do I have to put a non-zero value in the last argument, >documented as "Reserved" ? You should not need to increase sizeof FILEFINDBUF.achName, it was increased to CCHMAXPATHCOMP (255) with OS|2 1.2. Check you are using new 1.2 headers. The documentation states that the maximum filename that can be retrieved by DosFindFirst() is 13 bytes (8.3 + null). To retrieve a longer filename, you must use DosFindFirst2(). This is not entirely true. Long filenames can be retrieved using DosFindFirst() if the LONGNAMES bit is set in the executable header. This can be done with the SDK 1.2 markexe utility: markexe lfns program.exe. DosFindFirst2() works regardless of the setting of LONGNAMES bit, and in addition allows the retrieval of selected extended attributes. However, its use will prevent your application from running on OS| 1.1... unless you selectively run-time dynamic link to DosFindFirst2() -- UGGH! DosFindFirst2 was unnecessary, it *should* have used the reserved parameter in DosFindFirst()! OS|2 2.0 fixes this bug :-) -- Derek Baum consulting at: Sun Microsystems Internet: dbaum@East.Sun.COM (508)671-0456 UUCP: ...!sun!suneast!dbaum