Hi,
my target is too read all Data from a device ((block is more important than char, but best would be a solution that works on both))
Can u tell me wich funktion i should use?
I tried fread...
Type: Posts; User: haderach
Hi,
my target is too read all Data from a device ((block is more important than char, but best would be a solution that works on both))
Can u tell me wich funktion i should use?
I tried fread...
Solution:
1 #include <fcntl.h>
2 #include <linux/fs.h>
3 #include <stdio.h>
4
5
6 main(int argc, char **argv)
lseek(2)
perhaps lseek isnt the answer to my problem but pv uses it :
77 if (S_ISBLK(sb.st_mode)) {
78 /*
79 * Get the size of block devices by opening
I am using Linux and i use it on an usbstick (/dev/sdb)
sudo ./fs /dev/sdb
cat fs.c
#include <sys/types.h>
I just copied the code out of the man-Page but:
printf("File size: %lld bytes\n", (long long) sb.st_size);
always prints: "0" if u have a block device.
Hi,
i need to get the Size of a file (e.g. ~/files/hallo.txt) and the size of a deivce (e.g. /dev/sdb).
Is it possible to get both with the same functions?
Do i need to use specific...