Questions tagged [low-level-io]

Byte or character level I/O or functions for performing I/O operations on descriptors.

Byte or character level input/output or functions for performing input/output operations on descriptors.

71 questions
0
votes
1 answer

Will my program return the correct position I wanted after meeting a set number of newlines?

I'm trying to read a file backwards (say 10 lines at the end of the file). I would increment my new line counter (newline_counter) everytime it reads a '\n'. Once newline_counter reaches user_num (argument), say 10 lines, lseek() would stop at the…
Jing Tan
  • 19
  • 3
0
votes
1 answer

writing files at a low level

I was reading the GNU C PROGRAMMING TUTORIAL online, and get some confusion on the code example for low level read & write. The code is as below: #include #include int main() { char my_write_str[] = "1234567890"; char…
Marvin Zhang
  • 169
  • 1
  • 8
0
votes
1 answer

How to get number of bytes from stdin and input file using low level system calls

How do I get the number of bytes from stdin and input file using low level system calls? like read(2) & write(2) I used lseek to get the number of bytes from input file but lseek will not work standard input. I want to try to read the file or the…
Nicole
  • 37
  • 4
0
votes
3 answers

golang write struct as raw data

I am working on a new type of database, using GO. One of the things I would like to do is have a distributed disk so that I can distribute queries over multiple machines (think Pi type architectures). This means building my own structures on raw…
0
votes
2 answers

How do you "flush" the write() system call?

I am taking input from the user and then printing it to the standard output using read() and write() system calls. For some reason, it prints a few extra characters in addition to the regular output. The additional characters are from the user…
HelpMe
  • 7
  • 1
  • 6
0
votes
3 answers

C - Hertz to Seconds and how to get the proper time for a delay?

I am playing around with a PIC 24 and currently I have a bit of a problem with converting hertz to seconds and then using it as a delay for a signal send to a piezo piece(buzzer, zoomer, speaker, etc) and I would like to make it play certain…
Joe Carr
  • 445
  • 1
  • 10
  • 23
0
votes
1 answer

Unable to get key events for touchscreen keyboard from /dev/input/event1

I am unable to get key events from /dev/input/event1. What i'm able to filter out from its output is absolute X and Y touch coordinates from event code 53 and 54. I'm confused why there's no output with event code 1 when i type on my soft keyboard.…
0
votes
0 answers

Service Calls Executing Based on User Input

I've just written my first MIPS addition program. My output is expected ($t0 + $t1 = $t2), but I have a question regarding some strange behavior that I believe should be avoidable. On the lines where I gather the user input (li $v0, 5), the value…
zcoon
  • 174
  • 11
0
votes
0 answers

Communicating with Intel integrated graphics adapter in UEFI (Minnowboard and EDK2)

I'm trying to get a good understanding of how a graphics adapter works and how a graphics driver is built. So far I've read intel's (very technical) documentation, looked into linux i915 drm driver, and searched the net for more information for…
dem0
  • 1
0
votes
1 answer

How to properly error trap read in c to get byte number from a file descriptor

I am currently writing a small dummy program to try and get the hang of properly using the read in c. I made a small function called readdata to read from the file descriptor and store in a buffer then return the number of bytes read. My problem is…
0
votes
1 answer

Reading strings with read() system call in C

I need to implement a C function ssize_t readString(int filedes, char* buf, ssize_t max); that reads a string from file associated with file descriptor 'filedes' , into buffer 'buf' and returns the number of bytes read. The 'max' variable isn't…
Da Mike
  • 447
  • 4
  • 17
0
votes
1 answer

Very Simple Crypt Program Error

I'm creating a program that takes a file as input & outputs the decrypted password of each line. The file contains three lines of encrypted passwords. I am guaranteed that the passwords decrypt to 4 letter words. Given that i have created an char[]…
kids love
  • 61
  • 2
0
votes
1 answer

In low level, how is a character is printed to console

I am studying the source code of a simple OS (simple but real, one that can actually run on a x86 computer), and I am not sure the process that a character is sent to and displayed on the console monitor. In the source code of the routine for…
0
votes
0 answers

Two children reading alternately words in C using open() and read()

i'm facing a problem with reading from two input files with two children. The two children should read alternately a word from each file, sending them to the parent that will output them like this: input1: "I really" input2: "am stupid" output: "I…
Aster
  • 143
  • 2
  • 11
0
votes
1 answer

Inventory Restock with MATLAB (Low-Level I/O)

It's that time again where I/Os are confusing me. In this case, my goal is to write a function that takes in a .txt file of inventory items and another .txt file of price and outputs the total cost of restocking the items, as well as a .txt file…
Jessica Marie
  • 293
  • 5
  • 16