Re: how to find device number through shell script?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On linux,
stat --format=%D <filename>

I hope there will be a stat/stat64 commands in solaries.

Cheers,
Ganesh

On 2/28/07, mayank sharma <emailtomayanksharma@xxxxxxxxx> wrote:
I forgot to mention....particular on solaris


On 2/28/07, mayank sharma < emailtomayanksharma@xxxxxxxxx > wrote:
Hello,

How can I find device number of a device through shell script. I know how could it be done in C

code snippet:

int main()
{
        struct stat64 buf;
        char *filepath = "/dev/dsk/c0t0d0s0";
        if ( stat64(pszMountPoint, &buf) == 0 )
        {
                printf( "Device Number = %d", buf.st_dev);
        }
        return 0;
}


--
Regards,
Mayank Sharma




--
Regards,
Mayank Sharma

Software Engineer
Symantec,Pune


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux