To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10511
10510  |  10512
Subject: 
Re: *** Correction: LDView Version 3.1 Released ***
Newsgroups: 
lugnet.cad, lugnet.cad.dev
Followup-To: 
lugnet.cad.dev
Date: 
Wed, 22 Nov 2006 04:59:25 GMT
Viewed: 
1169 times
  
(FUT lugnet.cad.dev)

In lugnet.cad, Dean Earley wrote:
rmelkert wrote:
LDView 3.1 wont load a model when it's sub models are (just like the
main file) in a root of a drive, D:\ in my case.

When you move all to a subfolder it works fine. Usually I don't keep
stuff in the root except folders but I was testing something I just
downloaded.

This is normally just an extraneous \
No folders normally have them except the root so you need to
conditionally add the \.

Actually, all the string handling code for the path stuff is fine (and
cross-platform to work in both Windows and *nix).  After doing some
investigation, I discovered that the problem is that when we do a stat on the
directory, that doesn't work for a drive letter followed by a colon with no
slash or backslash after it.  (I say we because it's in code that Lars
originally wrote, but I modified; I'm not 100% who originated this particular
code.)

Lars, the ldrawini code in LDView might be somewhat changed from what you have,
but I'm pretty sure what you have will fail also if the model path is something
like D:.  The following code right before the existing stat call in IsDir fixes
the problem:

#ifdef _WIN32
    if (strlen(Path) == 2 && Path[1] == ':')
    {
        char NewPath[4] = "";

        strcpy(NewPath, Path);
        NewPath[2] = '\\';
        if (stat(NewPath, &Stat) == 0)
        {
            return Stat.st_mode & S_IFDIR;
        }
    }
#endif



Message is in Reply To:
  Re: *** Correction: LDView Version 3.1 Released ***
 
(...) This is normally just an extraneous \ No folders normally have them except the root so you need to conditionally add the \. (...) It should look in the LDraw.ini file that gives the correct path. From c:\WINDOWS\ldraw.ini: [LDraw] (...) (18 years ago, 20-Nov-06, to lugnet.cad)

5 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR