Node fs.writefile from Mac to Windows Share

778 Views Asked by At

While developing a Node application on a Mac, I attempted to write a file into a Windows share using the fs module. It seems to be treating the entire path as a file name, and instead of saving to the file to the proper directory, it saves it to the working directory.

const fs = require('fs')

var filePath = '\\\\hostname\\share\\...\\test.txt'

fs.writeFile(filePath, 'testing', function(err){
    if(err) console.error(err)
})

Is there a simple way to access this share from a Mac?

0

There are 0 best solutions below