TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Tosh Maddox
from: Jonathan de Boyne Pollard
date: 1995-12-27 15:59:48
subject: HPFS detect in Turbo Pas

TM>
  > Does anyone have a snippet of code to detect a HPFS drive in OS/2 using
  > either Turbo Pascal, BPOS2v_2 (c't), or VP, could you please post a small
  > sample?
TM>
                     Frequently Given Answer # 156
                     -----------------------------

   How do I detect HPFS drives in OS/2 ?
   =====================================

   The short answer, that applies to 90% of the people who ask this
   question, is not one that most people like to hear:  You don't.

   Many people equate "detect HPFS" with "determine that
long filenames
   can be used when creating files".  This is not the case.  With the
   multiplicity of filesystems available on OS/2, there are at least
   three (if not more) different filesystems that support long
   filenames: Netware, HPFS, and PC-Support.

   Yes, you can detect, via DosQueryFSAttach, whether the name of the
   filesystem driver for a drive is "HPFS", but that means that your
   program fails to use long filenames on Netware fileservers, on
   PC-Support shared folders, and on any other filesystems that may
   support long filenames, either now or in the future.

   As to detecting whether a filesystem supports long filenames, the
   only answer is to suck it and see.  Try to create a file with a
   non-8.3 filename on the drive, and see whether an error is returned
   or not.

   If, of course, the error is that the drive is read-only, or that you
   do not have the access rights to create files, you don't lose
   anything by this latter test; if you cannot create a file at all, it
   doesn't really matter whether you can save files with long filenames
   or not.

  > JdeBP <
___
 X MegaMail 2.10 #0:
--- Maximus/2 3.00
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515
SEEN-BY: 712/517 628 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.