Findfile BCAD vs ACAD small difference

Hi Forum,
In ACAD there is a quick way to get a parentfolder of a folder using lsp findfile function with the 2 dots ".."
(findfile "C:\Folder\Subfolder\..") will return: "C:\Folder"

Bricscad will return "C:\Folder\Subfolder\.."

Is there a more simple way to get the same in BCAD or only to "string manipulate"
(PS! I am writing double backslash, but seem to get removed when posting)
BR
Carsten

Comments

  • Hi, Carsten,

    interesting effects, indeed :-)

    I think, using (vl-filename-directory) 2 times should work ... passing the result of first call to the second call (not tested yet);
    but I will try to implement the same behaviour for BricsCAD's Lisp engine ...

    hope this helps & many greetings !

  • meanwhile (findfile) has been improved to match that AutoLISP behaviour :-) Will be in V21 then.
    many greetings !

  • I noticed this difference in behaviour many versions ago in BricsCAD, but concluded that BricsCAD LISP was more correct in behaviour. In every directory there is always a file called "." & ".." , BricsCAD LISP returning this with findfile is consistent behaviour to me IMHO.

    In BricsCAD to find the subfolder you would use

    (findfile "C:\\Folder\\Subfolder\\..\\")
    "C:\\Folder"
    

    However, this form won't work in AutoCAD

    Perhaps it is possible to add compatibility to AutoCAD whilst retaining BricsCAD's existing behaviour.?

    Regards,
    Jason Bourhill
    BricsCAD V20 Ultimate
    CAD Concepts

  • Torsten Moses
    edited August 2020

    Dear Jason,

    in V21, both notations will work :-)

    (findfile "C:\\Downloads\\Core\\..")  "C:\\Downloads"
    (findfile "C:\\Downloads\\Core\\..\\")  "C:\\Downloads"
    

    many greetings !

  • A late thanks for replies and input on this.