I need to read a file of my server without mounting it...

Hello,

I am having trouble figuring out how to read a text file off my server without actually mounting the server. Do I use a shell script? The server also has a login and password.

Somthing like this:


set MY_DATA to (do shell script "000.000.000.000/Volume_Name/mydata.txt")

Or somthing like this:


set MY_DATA_PATH to "000.000.000.000/Volume_Name/mydata.txt" as string
set f to open for access file MY_DATA_PATH
set MY_DATA to read f as text
close access f

Any information would be greatly appreciated!
Thanks,
CarbonQuark

What protocols can you use? As you are talking about mounting it is probably afp or smb, but can you also use http, ftp or ftps? In that case you could use curl. Type “man curl” in the Terminal for more details.

The server is setup to accept smb and afp. I nomally use afp. As far as http, it is enabled but secure only (login and password).

Thanks,
CarbonQuark

Ok, I have it working using curl… but the time it takes to curl is very long (the text file only has a couple of text lines). Is there a faster way to read the file?

Thanks,
CarbonQuark


set MY_DATA to do shell script "curl ftp://username:password@000.000.000.000/mydata.txt"