Is there a function that I can use to find out if a file is a block device? And another for a character device. I'm trying to create a funtion that will build a string the is exactly like the result you get from running ls -l for a slightly larger program I'm working on. Maybe it would save me some time if that function already existed, what would be helpful as well. Thanks.
Jump to Post
I get something in my linux system with module pyudev
>>> from pyudev import Context, Device >>> context = Context() >>> d = Device.from_device_file(context, '/dev/sda') >>> d.subsystem u'block'
All 6 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.