filenames with spaces in /sys?

Christian Kujau lists at nerdbynature.de
Mon Apr 28 04:35:51 EST 2008


Hi,

I was a bit puzzled today when I came across
/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0/power
and thought to myself: why are there spaces in "PMU battery 0"? Wouldn't
../pmu-battery.0/power_supply/PMU_battery_0/power be feasible too? I find 
it rather annoying to special case the spaces whenever to look for 
something in /sys, when I'm so used not to when doing the same 
find/grep/xargs stuff in /usr/src/linux.

There are ~2000 directories in my /sys but only a handful contain spaces:

# find /sys/ -type d -regex '.*\ .*' | sort -u
/sys/bus/mdio_bus/drivers/Broadcom BCM5411
/sys/bus/mdio_bus/drivers/Broadcom BCM5421
/sys/bus/mdio_bus/drivers/Broadcom BCM5461
/sys/bus/mdio_bus/drivers/Broadcom BCM5464
/sys/bus/mdio_bus/drivers/Broadcom BCM5481
/sys/bus/mdio_bus/drivers/Broadcom BCM5482
/sys/bus/mdio_bus/drivers/Generic PHY
/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0
/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0/power

Hm, OTOH /proc also does contain some elements with spaces in it (e.g. 
/proc/irq/47/GPIO1 ADB)...so, in short: would patches be accepted to
turn ' ' into '_' again (if they don't break too much userspace stuff)?

Thanks,
Christian.
-- 
BOFH excuse #373:

Suspicious pointer corrupted virtual machine



More information about the Linuxppc-dev mailing list