I’m having problems figuring out the file-plugin.
Everything works fine except for that little extra…
I’m writing a text file from a string variable. The text file is created and is ok.
I also keep a copy of the file in a BOLB field in the db.
This is where I’m having problems!
If I store the string I loose all the new line characters ‘\n’!?
If I store a file, when I try to open it I have the same problem (no newline chars)!
I’ve tried, the binary approach, without success:
// Writing
// sourceFile is path to good file
f_field = plugins.file.readFile(sourceFile); // store in bin format
//...
// reading
var fname = 'C:\\temp\\export.txt';
plugins.file.writeFile( fname, f_field);
application.executeProgramInBackground('notepad.exe', fname);
I’ve also tried the TXT way, also loosing the newline chars:
/ Writing
// sourceFile is path to good file
f_field = tempText; // store contents of string var
//...
// reading
var fname = 'C:\\temp\\export.txt';
plugins.file.writeTXTFile( fname, f_field);
application.executeProgramInBackground('notepad.exe', fname);
Any hints to put me on the right track?
Txs,
Miguel