fixed nasty bug with the write command
added final parameter to open to set file mode
apparently 'char charbuf[] = "astring" ' syntax doesn't work with previous cuda versions. changed test file to most general version. investigating...