Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. afternoondelite

    Using read as a system call

    Thank you very much, Salem. Worked like a charm. And about the macros, hah.. I was actually suggested to do that from this one website I was trying to figure out this on. Thanks for that link.
  2. afternoondelite

    Using read as a system call

    Yeah, I tried that as well. Worked fine for printf. I commented it out. It did not work for write when I wrote it out to the file. It would write the entire buffer to the file.
  3. afternoondelite

    Using read as a system call

    I tried doing + 1 after I realized that, but it didn't work either. It was as if too much space was being allocated if the byte size was odd. I ended up multiplying the total byte size by two and allocating that space and it worked out just fine. I'm sure that's not the appropriate way to...
  4. afternoondelite

    Using read as a system call

    Checking each character on the first one. char:h char:e char:l char:l char:o char: char:w char:o char:r char:l char:d char: char:Ù char: char: Checking each character on the second one: buff1 len: 4 tot_bytes: 15 buff1 len: 15 bytes_read: 15 hello worldsss char:h char:e char:l char:l char:o...
  5. afternoondelite

    Using read as a system call

    I have to create a program with a system call and something is driving me nuts. For some reason I get really odd results from a file with an odd number of characters: 48 struct stat buffer1; 49 fstat(d1, &buffer1); 50 size_t tot_bytes1 = buffer1.st_size; 51 char *buff1 =...

Part and Inventory Search

Back
Top