public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Srihari Vijayaraghavan <harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Issue reading files under /proc/acpi using python.
Date: Thu, 6 Feb 2003 22:45:44 +1100	[thread overview]
Message-ID: <200302062245.44847.harisri@bigpond.com> (raw)

Hello,

While I can read /proc/acpi files fine using 'cat', python is unable to read 
files under that directory.

Here is how you can reproduce the issue:

$ cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         65120 mWh
last full capacity:      61627 mWh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 6156 mWh
design capacity low:     0 mWh
capacity granularity 1:  1480 mWh
capacity granularity 2:  1480 mWh
model number:            4000
serial number:           1
battery type:
OEM info:                 COMPAQ
$
$ cat /proc/version
Linux version 2.4.21-pre4-acpi (hari-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org) (gcc version 3.2 
20020903 (Red Hat Linux 8.0 3.2-7)) #1 Thu Feb 6 00:12:06 EST 2003
$
$ python
Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> file("/proc/acpi/battery/BATO/info").read()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or directory: '/proc/acpi/battery/BATO/info'
>>> file("/proc/version").read()
'Linux version 2.4.21-pre4-acpi (hari-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org) (gcc version 3.2 
20020903 (Red Hat Linux 8.0 3.2-7)) #1 Thu Feb 6 00:12:06 EST 2003\n'
>>>

Softwares involved:
Kernel: Linux-2.4.21-pre4 + acpi-20030125-2.4.21-pre3.diff.gz
Rest all as in Red Hat 8.0 (with official updates)
(BTW same behavior is observed with Red Hat beta 8.1, which has updated 
versions of gcc, glibc, python etc..)

It will be great if I can read all the ascii text files under /proc/acpi using 
python, like /proc/cpuinfo, /proc/meminfo, /proc/version etc.. files.

Thanks
-- 
Hari
harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

             reply	other threads:[~2003-02-06 11:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-06 11:45 Srihari Vijayaraghavan [this message]
2003-02-06 11:59 ` Issue reading files under /proc/acpi using python Chmouel Boudjnah
     [not found] ` <200302062245.44847.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-06 12:30   ` Sergio Visinoni
     [not found]     ` <20030206133039.A10882-mRUH1VNo/yu/RHH9vPZxQGD2FQJk+8+b@public.gmane.org>
2003-02-06 12:43       ` Srihari Vijayaraghavan
     [not found]         ` <200302062343.38789.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-06 14:00           ` Ducrot Bruno
     [not found]             ` <20030206140059.GR1205-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
2003-02-07 13:09               ` Srihari Vijayaraghavan
     [not found]                 ` <200302080009.18002.harisri-bzGI/hKkdgRBDgjK7y7TUQ@public.gmane.org>
2003-02-07 14:46                   ` Ducrot Bruno
2003-02-09 18:28                   ` Axel Müller
2003-02-06 13:51       ` truc pour les francophones sur la liste Stefan Behnel
     [not found]         ` <3E426861.900-8NdywcgfOMlWMvVl7B+zuCEWGD4kr0XT@public.gmane.org>
2003-02-06 16:31           ` Ducrot Bruno
2003-02-06 13:49   ` Issue reading files under /proc/acpi using python Ducrot Bruno

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=200302062245.44847.harisri@bigpond.com \
    --to=harisri-bzgi/hkkdgrbdgjk7y7tuq@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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