[comp.sys.next] NXTypedStream

c6787903@scheme.cs.ubc.ca (marko ragnar riedel) (03/22/91)

Hi,

I've been running into lots of problems with typed streams.
My guess is that I'm missing something obvious.
Here's the problem.

I'm using NXTS's to write (among other things) the following

char *signature="MINE";
int count="1991";

/* do something horrible that doesn't involve streams */

NXWriteTypes(theFile, "*i", &signature, &count);

/* doesn't work -> segmentation fault, leaving out '&' and using just signature fails also (and should, according to docs)*/

/* tried replacing line with : */

NXWriteArray(theFile, "c", strlen(signature), signature)
NXWriteArray(theFile, "i", 1, &count);

/* works fine, but when I attempt to read the stuff (in another method) using : */

NXReadArray(theFile, "c", strlen(signature), signature)
NXReadArray(theFile, "i", 1, &count);

/* I get "typed ..blah.. reading "[10c]" when '@' expected ... " - '@' stands for an object, according to docs; */
/* However, I never wrote any objects to that stream .. so WIH is my app looking for one? */


Anyways, if anyone can make sense of this || just give me some hints || provide an example of properly used NXTS's,
I'd really appreciate it.

Thanks.

Marko

PS: Same problem if 

char signature[16];
strcpy(signature, "MINE")

is used instead.


I tried the OxDictOfQuot also, to no avail: 8-) 8-)


WORDSWORTH:
Still glides the stream, and shall forever glide,
The form remains, the Function never dies.
BROOKE:
Fish say, they have their stream and pond;
But is there anything beyond?