Menu

#249 io.icn: pathfind fails, shows $FPATh in err msg, does not look there

open
nobody
None
5
2017-08-26
2017-05-31
No

Testing cfuncs:
moved libcfunc.so to /usr/local/bin
TRACE=-1 FPATH=/usr/local/bin ./cfuncs
: main()
cfuncs.icn : 10 | gen(procedure bitcount,500)
cfuncs.icn : 18 | | bitcount(list_1 = [500])
cfunc.icn : 40 | | | pathload("libcfunc.so","bitcount")
io.icn : 754 | | | | pathfind("libcfunc.so","/usr/local/bin /...",&null)
io.icn : 711 | | | | | isabspath("libcfunc.so")
io.icn : 696 | | | | | isabspath failed
io.icn : 735 | | | | pathfind failed
cannot find "libcfunc.so" on path ". /usr/local/bin /aufs/uni5197sim/bin:/aufs/uni5197sim/bin/"
# ^ note: spaces and colons mixed
# also, if iconx is not on path,
# its dir is not checked for the lib

Related

Bugs: #264
Bugs: #91
Feature Requests: #54

Discussion

  • Charles Evans

    Charles Evans - 2017-05-31

    workaround:
    FPATH=/usr/local/bin/: ./cfuncs
    # ^ works. note the ^ :

     
  • Charles Evans

    Charles Evans - 2017-06-09

    src/runtime/imain.r has
    "FPATH=%s %s"
    while pathfind looks for dir:dir

     
  • Charles Evans

    Charles Evans - 2017-06-09

    icont always adds " dir dir dir ..."
    to $IPATH and $LPATH
    see common/mlocal.c: libpath()

    pathfind by default checks $DPATH, or else $PATH, and it must use for these
    by default the system's separator, ok.
    Is this documented anywhere?

    pathload checks $FPATH, which ALWAYS has spaces, by calling pathfind(fname,path)
    It is looking for ":" or ";" because psep is omitted.
    should be called as
    pathfind(fname,path," ")

     
  • Charles Evans

    Charles Evans - 2017-06-09

    on any UNIX:
    pathload before [r2724]
    added " dir" then called pathfind
    which searched for dir:dir
    currently pathload adds ":dir"
    after iconx added " dir"
    giving "dir dir:dir"

     

    Related

    Commit: [r2724]

  • Charles Evans

    Charles Evans - 2017-06-09

    If FPATH is like icon's IPATH,
    not like system's PATH,
    io.icn needs:
    in procedure pathload:
    - path ||:= psep || sfeat[13:0]
    + path ||:= " " || sfeat[13:0]
    +# this can be changed by patchstr iconx newpath
    - found := pathfind(fname, path)
    + found := pathfind(fname, path, " ") # pathfind prepends "."

     
  • Charles Evans

    Charles Evans - 2017-08-25

    I can take this if you like

     
    • Jafar

      Jafar - 2017-08-25

      Please do!

       
  • Charles Evans

    Charles Evans - 2017-08-26

    fixed in [r5610]

     

    Related

    Commit: [r5610]


Log in to post a comment.