filenames with spaces in /sys?

Scott Wood scottwood at freescale.com
Tue Apr 29 01:31:27 EST 2008


On Sun, Apr 27, 2008 at 08:35:51PM +0200, Christian Kujau wrote:
> 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"?

Why not?

> Wouldn't ../pmu-battery.0/power_supply/PMU_battery_0/power be feasible too? 

Feasible, yes, but uglier, and as you point out, changing it now would
risk breaking userspace for little gain.

> 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.

If userspace tools make it awkward to deal with filenames with spaces,
let's fix the userspace tools.  /sys is certainly not the only place
they'll be found, and waging war against them is a battle best left for
a couple decades ago.

-Scott



More information about the Linuxppc-dev mailing list