LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Kujau <lists@nerdbynature.de>
To: dwmw2@infradead.org
Cc: linuxppc-dev@ozlabs.org
Subject: filenames with spaces in /sys?
Date: Sun, 27 Apr 2008 20:35:51 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.1.10.0804272012000.11017@sheep.housecafe.de> (raw)

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

             reply	other threads:[~2008-04-27 18:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 18:35 Christian Kujau [this message]
2008-04-27 18:54 ` filenames with spaces in /sys? David Woodhouse
2008-04-27 19:44   ` [PATCH] " Christian Kujau
2008-04-28 15:31 ` Scott Wood
2008-04-29 21:54   ` Christian Kujau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.1.10.0804272012000.11017@sheep.housecafe.de \
    --to=lists@nerdbynature.de \
    --cc=dwmw2@infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox