X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sat, 20 Dec 2003 17:26:39 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <3405-Sat20Dec2003172638+0200-eliz@elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <3FE2EA13.8020407@lml.ls.fi.upm.es> (message from Manuel Collado on Fri, 19 Dec 2003 13:07:47 +0100) Subject: Re: Detecting system features References: <3FE06890 DOT 6060006 AT lml DOT ls DOT fi DOT upm DOT es> <9003-Wed17Dec2003201922+0200-eliz AT elta DOT co DOT il> <3FE199FF DOT 9060708 AT lml DOT ls DOT fi DOT upm DOT es> <8011-Thu18Dec2003183309+0200-eliz AT elta DOT co DOT il> <3FE2EA13 DOT 8020407 AT lml DOT ls DOT fi DOT upm DOT es> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Fri, 19 Dec 2003 13:07:47 +0100 > From: Manuel Collado > Newsgroups: comp.os.msdos.djgpp > > Return Value > ------------ > > If LFN APIs are supported and should be used, it returns 1, else 0. > > Note that if the `_CRT0_FLAG_NO_LFN' bit is set, or `LFN' is set to `N' > or `n' in the environment, both `_use_lfn' and `_USE_LFN' will always > return 0 without querying the filesystem. You can reset the > `_CRT0_FLAG_NO_LFN' bit at runtime to force filesystem to be queried. > === > > So to detect the true LFN system capability one should: > > - reset CRT0_FLAG_NO_LFN > - call _use_lfn > - restore CRT0_FLAG_NO_LFN to its previous value You dion't ned anything except a simple call to `_use_lfn'. The _CRT0_FLAG_NO_LFN bit is set to zero by default, and this is your program, so if you don't set it, it will stay unset. As for the LFN environment variable, it is usually uinset as well, but if you want to protect yourself against a user who sets it, you can use the library function `setenv' prior to calling `_use_lfn'.