So I have an executable UNIX file (which I extracted from a Mac App), and tried to duplicate it. The code is:
var dat = fs.readFileSync("~/FileZilla.app/Contents/MacOS/filezilla",{ flags:'r', encoding:"binary"});
fs.writeFileSync("~/filezilla_copy", dat,{ flags: 'w', encoding: "binary",});
But what I end up getting is an un-readable document file and not a UNIX EXE file. I can't even run it through terminal, although supposedly I created an exact duplicate of the original file. How do I get this file to be recognized as a UNIX file?