LB Booster
Programming >> Language extensions >> UNC paths
http://lbb.conforums.com/index.cgi?board=extensions&action=display&num=1473750307

UNC paths
Post by Richard Russell on Sep 13th, 2016, 07:05am

I have been reminded that LB 4 doesn't support UNC file paths ("\\server\path\file.ext") which can be a limitation if you are trying to open a file on a network server and you can't be sure that it is mapped to a consistent drive letter (or at all). Needless to say LBB doesn't have this limitation and UNC paths can be used whenever a filename is expected.

Richard.
Re: UNC paths
Post by Richard Russell on Sep 18th, 2016, 5:56pm

Here's an LBB version of a demo program posted recently by Chris Iverson, demonstrating that UNC paths work without any need to use direct API calls:

Code:
    print "Attempting to open test document on SysInternals share."
    print "This may take a while, depending on your internet connection..."
    print
    open "\\live.sysinternals.com\Tools\About_This_Site.txt" for input as #hFile
    print hwnd(#hFile)

    while not(eof(#hFile))
        input #hFile, a$
        print a$
    wend

    close #hFile  

You may find that the program takes a long time to open the file, or even times out and fails to open it at all, depending on the availability of the SysInternals server at the time.

Richard.