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
1
vote
3 answers

De-referencing pointer to a volatile int after increment

unsigned int addr = 0x1000; int temp = *((volatile int *) addr + 3); Does it treat the incremented pointer (ie addr + 3 * sizeof(int)), as a pointer to volatile int (while dereferencing). In other words can I expect the hardware updated…
jithu83
  • 539
  • 6
  • 11
1
vote
2 answers

asking and reading in user input using unbuffered IO routines

We just started the topic of low level functions in C and for a part of this assignment we have to ask for user input. Normally I would use printf() and scanf() however for this assignment we are only allowed to use read(), write(), open(),…
user3538161
  • 387
  • 1
  • 4
  • 6
1
vote
0 answers

Low Level IO with Crypt

I am trying to compare a encrypted string that is taken from each line of a file to AAAA-ZZZZ until it finds its match of the password. I am guaranteed that the user password is of 4 characters. What I am trying to do is take in the file using…
kids love
  • 61
  • 2
1
vote
1 answer

Low Level File I/O Compare Strings

I'm writing a program that takes a file with the 3 lines of encrypted passwords and compares them to all 4 lower case letters from aaaa - zzzz. The only issue I am having is that I can't figure out how to go line by line of the file I input and how…
kids
  • 57
  • 7
1
vote
1 answer

View the contents of a file at block level/sector level

I wanted to know if there is a command to view the details/contents of the file at the sector/block level? Meaning ,I want the following details: I have 2 files.I needed to know whether the contents stored at the block/sector level are same for the…
SRK
  • 49
  • 8
1
vote
2 answers

Low Level I/O - Read/Creat/Write (C)

I'm trying to use low level functions in C and wanting to read from the STDIN and store that information in a file. int dash, c; char buffer[1024]; if((dash = creat("file.txt", S_IRWXU)) < 0) perror("creat error"); while ((c =…
MBan
  • 58
  • 1
  • 5
1
vote
1 answer

What is "complete error trapping"?

Write a program in C using only low-level I/O.. The program must have complete error trapping. In particular the program should use perror() to report system errors... In my program... test("checked argument count"); if((input_file1 =…
user2931210
1
vote
1 answer

How does a program actually receives character input? From scan code to the final raw input bits

So, my question is simple: How does a program receive the raw input bits after user "inputs" (from physical keyboard or any other way) a character key? I mean I know how character encoding works after it's been received by the program as raw bits…
ntpl
  • 155
  • 6
0
votes
1 answer

i got Bad file descriptor error when call function with using fd

i have trouble to use file descriptor #include #include #include #include #include #include #include "line.h" #include "char.h" #define DEFAULT_PREFIX "x" #define DEFAULT_CHUNK_SIZE…
springbook
  • 21
  • 2
0
votes
0 answers

How do you push a block of text in C to make space and write in a file using low level I/O?

So I have to write in a file that already has text in it , using Low Level I/O, but I have to write in the middle of that text so I need to push that text and make space, same strategy for deletion, but I don't have an idea on how to do it . The…
0
votes
0 answers

Using execvp with low level IO and standard input

I am trying to use low level IO (Read) to read in standard input for a command. After getting that command I try to pass it into execvp so that it can carry out the command but it is not working. I think the problem is I am not sure how to pass it…
0
votes
2 answers

Allocating and initializing a buffer with file data using a single loop

I try to read a file to a buffer using a low level file descriptor. The method suppose to store the file data byte by byte to a char * buffer, parse that data, and then free the allocated buffer. static void parse_file(char path[11]) { int fd =…
siery
  • 467
  • 3
  • 20
0
votes
1 answer

Read specific section of a line in a formatted file with low level functions

I am trying to build an authentication system using C programming Language. I have already wrote the code for the functions to take user input (username & password) and to inset it into the database (a .txt file) in the following formatted way: ID …
user18530275
0
votes
0 answers

Read a huge log file line by line and random access in node?

I'm working on a log file reader which will parse files and display fields from lines in a nicely formatted table in a node/electron app. If the files were small, I could just read them line-by-line, parse them, store fields extracted from each line…
Shahbaz
  • 10,395
  • 21
  • 54
  • 83
0
votes
1 answer

Calculate the mean of an array in MATLAB

I have an array in Matlab "Numbers" that is stored in the workspace as a 400x1 double. I know how to calculate the mean of this data, but the problem I have is actually writing the code to do this. I know there are functions built-in which I could…
JamesW
  • 43
  • 4