home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,454 of 2,978   
   Dr John Stockton to All   
   Re: Detecting whether a file has a Long    
   08 Mar 05 22:01:03   
   
   From: spam@merlyn.demon.co.uk   
      
   JRS:  In article <112rdj520sj6tae@corp.supernews.com>, dated Tue, 8 Mar   
   2005 15:26:58, seen in news:comp.lang.pascal.borland, F Verbeek   
    posted :   
   >   
   >"Dr John Stockton"  schreef in bericht   
   >news:y1vghdA4FMLCFwOk@merlyn.demon.co.uk...   
   >>   
   >> Interest has been expressed elsewhere in detecting whether a file has a   
   >> Long File Name, or whether a short name suffices.   
   >>   
   >> Now I think that a Win32 program can do that with the aid of the added   
   >> FindData field in a TSearchRec; but of course that is not an acceptable   
   >> solution here.   
   >>   
   >> BP7 in Win32 does not see the LFN entries, those with RHSV set.   
   >>   
   >> The following appears to do the job, if the output of   dir *.* /v   is   
   >> piped into it.  Any comment, before I start adding parameters to control   
   >> the output?   
   >>   
   >> Does    dir /v    always put the SFN in 1..12 and the LFN in 81..EoL ?   
   >>   
   >If I understand you correctly, you want us to compile the program into an   
   >executable called nametype.   
      
   Well, I'd expect you to read it first!   
      
   >next goto the dos prompt and type something like   
   >dir /v |nametype   
      
   That's how it is intended to be run.   
      
   >The result seems to be incorrect in win ME   
      
   Does dir /v give the SFN in 1..12 and the LFN in 81-end of a line, in   
   your WinME?  Unless it does, there is no hope, unless the program can be   
   made to recognise the OS.   
      
   In testing, one needs to be certain which files need only SFNs and which   
   need LFNs; it might be well to test with   dir %* /v | nametype   after   
   having created files   %1   %2   %Rather.A.Long.Name   assuming that no   
   other files start with % .  That looks rather safely like 2 SFNs and an   
   LFN.   
      
      
   The test used is whether the SFN is an exact match to the LFN, in which   
   case the name is considered short.  AIUI it is possible that it may have   
   a LFN entry matching the SFN somehow, but ISTM that the possibility   
   should be ignored.   
      
      
   To handle   DIR /S /V   well, the program will probably need to be   
   localised so that it can recognise "Directory of" (which, happily, is 12   
   characters with #9 non-space) in Foreign.   
      
   --   
    © John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v4.00   MIME. ©   
      TP/BP/Delphi/&c., FAQqy topics & links;   
        RAH Prins : c.l.p.b mFAQ;   
      Timo Salmi's Turbo Pascal FAQ.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca