phat code The number you have dialed is imaginary. Rotate phone 90 degrees and try again.
Main

Projects

Downloads

Articles

Links

Forum

 

View Message

Back to Messages
Peter Swinkels Thu Oct 10 2024 at 1:42 pm
Here's a quick test I wrote in C->
 
 
#include <stdio.h>

struct bufferstr {
 unsigned char data;
 unsigned char check;
};

int main() {
 struct bufferstr buffer = {0, 255};
 FILE *file = fopen("CLOCK$", "rb");

 if (file == NULL) {
  printf("Could not access CLOCK$.n");
 }
 else {
  if (fread(&buffer.data, sizeof(unsigned char), 1, file)) {
   printf("Data: %dn", buffer.data);
   printf("Check value: %dn", buffer.check);
  }
  else {
   printf("Could not read from CLOCK$.n");
  }

  fclose(file);
 }

 printf("Press Enter to exit.n");
 while (getchar() != 'n') {}

 return 0;
}


It appears to read a single byte from CLOCK$ without issue. I could try replicating my BASIC program in C just to see what happens for completeness sake. :-)
 
 
 
 

Reply to this Message

Name
Subject
Message

No HTML is allowed, except for <code> <b> <i> <u> in the message only.
All URLs and email addresses will automatically be converted to hyperlinks.