Fileread and Filewrite external file - Forum

Forum Navigation
You need to log in to create posts and topics.

Fileread and Filewrite external file

Greetings.

 

I would like to know if there is a way to use Fileread and Filewrite functions on an external file, perhaps on a NAS (maybe FTP) or a computer behind NAT (public ip+port forwarded to pc’s ip).

 

thanks

fkapnist has reacted to this post.
fkapnist
Quote from FGdesign on March 4, 2023, 11:23 am

Greetings.

 

I would like to know if there is a way to use Fileread and Filewrite functions on an external file, perhaps on a NAS (maybe FTP) or a computer behind NAT (public ip+port forwarded to pc’s ip).

 

thanks

I got this answer from GPT 3:

Yes, it is possible to use Fileread and Filewrite functions on external files stored on a NAS or on a computer behind NAT. To do so, you need to use a network protocol such as FTP, SFTP, or SMB. Depending on the type of protocol you use, you may need to provide credentials to access the remote file. Once you have established a connection with the remote file, you can use Fileread and Filewrite functions as normal.

.

Thanks, could you provide me with the exact syntax to do so?

fkapnist has reacted to this post.
fkapnist
Quote from FGdesign on March 4, 2023, 1:22 pm

Thanks, could you provide me with the exact syntax to do so?

You can use the Fileread and Filewrite functions in VisualNEO Win to read and write to remote files. The syntax for Fileread is as follows:

Fileread(sFileName, sMode, sProtocol, sUsername, sPassword)

The parameters are as follows:

sFileName: The complete path and filename of the remote file.

sMode: The file access mode, either "r" (read only) or "w" (write).

sProtocol: The network protocol to use. Valid options are "ftp", "sftp", or "smb".

sUsername: The username for the remote file.

sPassword: The password for the remote file.

The syntax for Filewrite is as follows:

Filewrite(sFileName, sMode, sProtocol, sUsername, sPassword, sData)

The parameters are as follows:

sFileName: The complete path and filename of the remote file.

sMode: The file access mode, either "a" (append) or "w" (write).

sProtocol: The network protocol to use

 

Thanks, although I’m using the old Neobook 5, where actual syntax is Fileread “path” “line” “[variable]”

Quote from FGdesign on March 4, 2023, 4:21 pm

Thanks, although I’m using the old Neobook 5, where actual syntax is Fileread “path” “line” “[variable]”

It is the same syntax for VisualNEO Win. I have been told by @luishp that GPT 3 often gives wrong answers.

So it is yet not completely reliable when it comes to writing code. Maybe a VB script function would do what you require.

Sorry.

My syntax looks like this image. I just want to edit/read a file on another pc, whatever protocol or NAT it requires.

 

It's the old Neobook 5, not Visual Neo though.

 

Thanks

Uploaded files:
  • You need to login to have access to uploads.
fkapnist has reacted to this post.
fkapnist
Quote from FGdesign on March 4, 2023, 5:08 pm

My syntax looks like this image. I just want to edit/read a file on another pc, whatever protocol or NAT it requires.

 

It's the old Neobook 5, not Visual Neo though.

 

Thanks

Neobook has these actions:

Internet > HTTP >

InternetFileExists "http://www." "" ""
InternetGet "" "" ""
InternetPost "" "" "" ""

But for more control, try using the NeoFM-FTP plugin:

https://visualneo.com/product/neofm-ftp

.

Welcome to NeoFM/FTP (visualneo.com)

.

asFTP - VisualNEO. Cross-platform App Development Tool for Windows

.

 

luishp has reacted to this post.
luishp