Write to file help please

I’m trying to write to file without success and I’m sure it’s a syntax problem. The file is on an SMB network drive.

I’m using

File = io.open("//192.168.1.1/Home_Drive/Folder/testout.txt")
File:write(“testing”)
File:close()

It’s not writing. Any thoughts?

You cannot use a URL as a file location specifier. It has to be on a path reachable from your mounted file system.

I hadn’t realised that. That’s a shame I really wanted to store it on a network drive.

If you can mount the network drive, then that’s fine. I used to do that with a CIFS mount.

Interesting. How do I mount the drive? I don’t know how to do that.

A forum search for CIFS will find 50+ references. Some are old, from UI5 (in 2016.). Included Lua Startup code to mount a disc.

I don’t know about doing this on UI7, but a while ago I did put in a request that Vera should support CIFS mounts natively, so no need to install an extra package.

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules