Search:

Type: Posts; User: haderach

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    1,510

    Read all Data from Device

    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...
  2. Replies
    9
    Views
    4,633

    Solved

    Solution:



    1 #include <fcntl.h>
    2 #include <linux/fs.h>
    3 #include <stdio.h>
    4
    5
    6 main(int argc, char **argv)
  3. Replies
    9
    Views
    4,633

    lseek(2)...

    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
  4. Replies
    9
    Views
    4,633

    I am using Linux and i use it on an usbstick...

    I am using Linux and i use it on an usbstick (/dev/sdb)

    sudo ./fs /dev/sdb


    cat fs.c


    #include <sys/types.h>
  5. Replies
    9
    Views
    4,633

    I just copied the code out of the man-Page but:...

    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.
  6. Replies
    9
    Views
    4,633

    File and Device Size

    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...
Results 1 to 6 of 6