Hardcopy Permitted

Photography Jobs Online

Learn Digital Photography Now

Get Instant Access

/sys/class/and/sys/block/

The interfaces of the devices are represented under these two directories.

For example, the interface belonging to the Olympus digital camera is represented by the directory /sys/block/sda/.

The directory sda is the digital camera accessed like a SCSI hard disk.

The following is the content of the sda/ directory:

DA3:~ # ls /sys/block/sda dev queue removable size device range sda1 stat

The subdirectory sda1/ represents the interface to the first partition on the camera's memory card.

For example, by reading the content of /sys/block/sda/sda1/size, you can determine the size of the partition; as shown below:

DA3:~ # cat /sys/block/sda/sda1/size 31959

The partition has a size of 31959 512-byte blocks, which is about 16 MB.

To connect an interface with a device, file system links are used. In the Olympus digital camera example, a link exists from the file /sys/block/sda/device to the corresponding device; as shown below:

DA3:~ # ll /sys/block/sda/device lrwxrwxrwx 1 root root 0 Aug 17 14:03 device ->

,./../devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/host0/0:0:0:0

Was this article helpful?

0 0
Digital Camera and Digital Photography

Digital Camera and Digital Photography

Compared to film cameras, digital cameras are easy to use, fun and extremely versatile. Every day there’s more features being designed. Whether you have the cheapest model or a high end model, digital cameras can do an endless number of things. Let’s look at how to get the most out of your digital camera.

Get My Free Ebook


Post a comment