I'm having a little trouble opening a file from an ftp site. Can anyone help? I thought treating it like a regular http site would work, but it does not. I'm just using the regular open command, like:
Open ( "ftp://ftp.nasdaqtrader.com/symboldirectory/nasdaqlisted.txt");
But that doesn't work. I've tried using delimiters, stripquotes, and all sorts of stuff. I can save it to my hard drive and import just fine that way. But when I try to nab it from the ftp site it doesn't work. Any ideas? Socket connection maybe? Datafeed()? Or does anyone know if it's possible to access the File>Internet Open feature found in the File menu bar?
Using 8.0.2 on WinXP sp2, the only way I have so far been able to open that file inside JMP is to manually do an Internet Open, specify the file as you have done but without the quotes, and choose Edit HTML or a Text page. When prompted for username and password I press Enter and then the file opens as a text file in the script editor. I don't know how to invoke Internet Open in a script...
Ok, I take that back. This also works: In scripting I execute the line Open() . In the resulting open dialog I specify the file as you did but without the quotes and I choose one of the 4 import methods. Then I click ok. JMP imports the file. When I check the Source script embedded in the imported file I see that the code does not directly reference the ftp site. It references a temporary local copy.
Thanks for the response mpb. It's good to hear other's ideas. So what you said got me thinking. Maybe instead of using JMP's Open() function, I could use window's kernel32.dll CreateFile function by marshalling the dll. Something like this, although this doesn't work and I'm not certain as to why:
It's still very strange to me that JMP lacks scripting support for FTP servers. There's also a ReadFile function in kernel32.dll that could be used to create an I/O stream, but I'm guessing it's probably much the same as JMP's socket connections.
I'd much rather be able to script the built-in menu command "File:Open Connection". It seems to do everything I want for I/O purposes.