🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4476

Re: How to find out if a drive-letter is 'subst' drive and if yes, what is the connected dir?

#4476
From: Andrue Cope [TeamB]
Date: Mon, 30 Jan 2006 10:53
40 lines
2582 bytes
MR wrote:

> Isn't there really no way to get the same under DOS?

There is probably an interrupt function to do that or else some
in-memory structure you can examine but DOS is..well...old :)

There's usually some way of doing what you want but whether it's
documented or supported by a given development platform is another
matter.

I think it unlikely that the same C++ code can be used in both Windows
and DOS. Even if it's possible in this particular case it simply can't
hold true in all cases - the two platforms are just too different. More
likely you will need to isolate such platform specific code in a
separate unit and have one such unit for each platform you intend to
target. Organised correctly you will probably end up with the following
(naming convention is up to you):

  Plat_DOS.Cpp/.h
  Code and declarations for DOS platform.

  Plat_Windows.Cpp/.h
  Code and declarations for Windows platform.

  Platform.Cpp/.h
  - #includes one of the above dependant on compiler (#ifdef/#endif)
  - Declarations for a standardised way of using the functionality
provided by the Plat_* units.
  - Code to translated the standardised public interface into the
correct calls for the platform specific units.

Ideally Platform.Cpp/.h won't contain any significant code just
function call wrappers but that is dependant on how good a job you do
in defining the Plat_* framework.

-- 
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <43ddef7a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.wiretrip.org!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <7e5mt1tgs8g8aiccinc8otj9e30htumds7@4ax.com> <43ddd465$1@newsgroups.borland.com> <ulnrt1thg3ol5n3gq5kdm094fgrkicrsk6@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,1f1d5f65bf11a172
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address>
Subject: Re: How to find out if a drive-letter is 'subst' drive and if yes, what is the connected dir?
Newsgroups: borland.public.cppbuilder.nativeapi
References: <7e5mt1tgs8g8aiccinc8otj9e30htumds7@4ax.com> <43ddd465$1@newsgroups.borland.com> <ulnrt1thg3ol5n3gq5kdm094fgrkicrsk6@4ax.com>
Date: Mon, 30 Jan 2006 10:53:25 +0000
User-Agent: XanaNews/1.17.6.6
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <43ddef7a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1138618234 217.207.223.34 (30 Jan 2006 02:50:34 -0700)
Lines: 40
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.wiretrip.org!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail