how to get the total and free size of the hard disk in vxworks - VxWorks

This is a discussion on how to get the total and free size of the hard disk in vxworks - VxWorks ; Dear all, i am using vxworks 5.5 and my cpu is PPC605.I want to know how to get the total size and free size of my hard disk which is 55GB that contains two partitions and i know the device ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: how to get the total and free size of the hard disk in vxworks

  1. how to get the total and free size of the hard disk in vxworks

    Dear all,

    i am using vxworks 5.5 and my cpu is PPC605.I want to know
    how to get the total size and free size of my hard disk which is 55GB
    that contains two partitions and i know the device name.Is there any
    way to get the information.Please help me to resolve this problem.I am
    using dosfs filesystem.
    Does statfs function will work?.Because i am not able to store more
    than 4GB that is around 32 bit wide.What causes the problem.


    Regards,
    robert


  2. Re: how to get the total and free size of the hard disk in vxworks

    Hi, Robert,
    statfs() worked fine for me (however my disk is 256M only).
    Suppose the disk name is "sd:". Then the following code will
    retrieve the size and free size:

    statfs ("sd:", & file_system_stat) ;
    printf ("Total File System Size: %dKB, Free space: %dKB.\n",
    (file_system_stat. f_bsize * file_system_stat.f_blocks /
    1024),
    (file_system_stat. f_bsize * file_system_stat.f_bavail /
    1024));


    HTH,
    Akiva Sadovski


  3. Re: how to get the total and free size of the hard disk in vxworks

    try to use ioctl. I'm sure that.

    you may need 64bit valiable..


+ Reply to Thread