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
12
votes
2 answers

Unicode paths with MATLAB

Given the following code that attempts to create 2 folders in the current MATLAB path: %% u_path1 = native2unicode([107, 97, 116, 111, 95, 111, 117, 116, 111, 117], 'UTF-8'); % 'kato_outou' u_path2 = native2unicode([233 129 142, 230 184 161, 229…
user2271770
12
votes
3 answers

How can I check to see if a file descriptor was closed?

In a POSIX environment when using system calls to manipulate text files (open(), close(), read(), write()), is there a way to to check to see if I actually closed a file descriptor when using close(file_descriptor)? Example: int main(int argc, char…
user2931210
7
votes
1 answer

ARM assembly using Qemu

Well i've searched whole internet for code that will run using arm-linux-gnueabi-as and qemu. To print a integer value. From string. A routine will help.
Waqas
  • 637
  • 8
  • 19
4
votes
2 answers

Why must I use \x1b not \ to represent an escape character

I've read that \x1b represents the escape character, but isn't '\' by itself the escape character? A tutorial wants me to write write(STDOUT_FILENO, "\x1b[2J", 4); to clear the screen. Why won't '\[2J' do the job?
Luke Kong
  • 71
  • 1
  • 7
4
votes
2 answers

How to use ioctl with FS_IOC_FIEMAP

My problem is to deal with sparse file reads and understand where the extents of the file are to perform some logic around it. Since, there is no direct API call to figure these stuff out, I decided to use ioctl api to do this. I got the idea from…
Aila
  • 319
  • 1
  • 4
  • 11
3
votes
3 answers

How do I import CSV data in to Matlab only using low level I/O commands

I am really struggling to work out how I can import CSV data which contains 9 columns and around 400 rows of data into a table in the Matlab workspace. This would be easy if I was allowed to use the built-in toolboxes Matlab has to offer, but…
JamesW
  • 43
  • 4
3
votes
1 answer

How to implement Async I/O efficiently in the kernel

This question is about low-level async I/O system calls like send + epoll/aio_read and others. I am asking about both network I/O and disk I/O. The naive way of implementing those async calls would be to create a thread for each asynchronous I/O…
Mike76
  • 899
  • 1
  • 9
  • 31
3
votes
2 answers

Low Level DBus C API main loop

When trying to use a callback function for a DBus reply I get stuck on creating a good/well working main loop. What I want to do is simple, make a DBus call and specify a function which should be called when the reply comes. This is because I do not…
Daniel Falk
  • 522
  • 4
  • 16
3
votes
1 answer

Chronicle Bytes from InputStream

I'm trying to use saxophone for parsing json to protobuf message on the fly, and want to avoid creating string instances for each response. For that i need to create Bytes instance from InputStream (that is provided from apache http entity). I'm…
vach
  • 10,571
  • 12
  • 68
  • 106
3
votes
1 answer

Printing contents of file to stdout low-level I/O in C

How would I go about printing contents of a file that I've appended to using only low-level I/O functions? The closest I get is printing the text that I'm using to append Example: file1.txt = dog file2.txt = cat I want file2.txt, which is now…
3
votes
2 answers

How to find if an NTFS logical cluster is free?

I would like to write a program that reads all the unused clusters on an NTFS volumne. (I'm looking to recover data from a file that was accidentally truncated). According to this page I can call SetFilePointer() and ReadFile() on the volume…
Mark
  • 4,749
  • 7
  • 44
  • 53
3
votes
1 answer

How to tell, what "exceptional condition" caused select() to react to errorfds?

According to its man page, the select() system call offers monitoring of three different aspects of one or more file descriptors: whether they are ready to read from, ready to write to, or whether an "error" or "exceptional condition" (language…
3
votes
2 answers

What is causing my program to hang and not exit properly? (pipe, read system call, while loop)

I have a program where I write from several child processes to a pipe, and then attempt to read all the messages written to each process, from each pipe, and print them to the screen. With the following code (specifically, the while loop using the…
Søren
  • 35
  • 1
  • 8
3
votes
2 answers

What is the meaning of low-level I/O? How do I implement it in this program?

I need to write a C program that accepts three command line arguments: input file one input file two name of output file The program needs to read the data in from files 1 and 2 and concatenate the first file followed by the second file, resulting…
user2931210
2
votes
2 answers

Low-level C I/O: When read from one file and write to another I'm hitting an infinite loop

I am working on an assignment that only allows use of low-level I/O (read(), write(), lseek()) as well as perror(). I have been able to open the nessisary in and out files with correct permissions, but when I output I get an infinite loop of the in…
Dan
  • 3,246
  • 1
  • 32
  • 52
1
2 3 4 5