cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
djhanson
Level V

File Exists () - can this work with HTML path?

Are there any tricks to get File Exists() to work with an internal html path (internal meaning a network drive represented as an html path and not UNC path)?

So far I cannot get it to recognize a file path that exists using the html path representation like below.  Are there any tricks to make this work or some other file check related command perhaps?  DJ

file exists("p:\\mypath\test.jsl"); //UNC path works (can find the JSL that exists)

file exists("html://mycompanyserver.com/mypath/test.jsl"); //HTML path does not work (cannot find the JSL that exists)

3 REPLIES 3
txnelson
Super User

Re: File Exists () - can this work with HTML path?

you can get the results you need by using a Load Text File function and if it can not load it, the result will be a missing value.

DoesItExist = Try(Load Text File(("html://mycompanyserver.com/mypath/test.jsl"));

If(char(DoesItExist) == ".", ....................);

Jim
msharp
Super User (Alumni)

Re: File Exists () - can this work with HTML path?

Another option is to map the network drive to Z: (or whatever).  The caution here is that different individuals in your company may have their network drives mapped differently (or not at all).  If you have a good IT department they should have already standardized this and it shouldn't be an issue.  Regardless, if this is for scripts you are only running on your computer there shouldn't be an issue.

10589_pastedImage_0.png

txnelson
Super User

Re: File Exists () - can this work with HTML path?

An additional word of caution on using a Mapped Network drive, the file that you are testing for are on a web server.  They may not be on a server that supports MS Windows Mapping access.  At my company, Linux is used for the web servers, without any Samba(Windows file services emulator) installed.  So the method I previously specified is what I had to use.

Jim