 |
Hamelin |
.pifferaio.magico.

Registered: Feb 2003
Posts: 662 (0.08 al dì)
Location: ..tra i monti intorno ad Hamelin..
Corso: Ingegneria Informatica
Anno: 3°
Time Online: 7 Days, 7:19:55 [...]
Status: Offline
Edit | Report | IP: Logged |
[Linux] fopen() fallisce
Scrivendo un piccolissimo programma in C, desideravo leggere informazioni sulla batteria da un file (in /proc/acpi): la fopen () fallisce... il problema sta nel fatto che il file è utilizzato da un altro programma (non è possibile aprirne una copia in sola lettura?)? oppure c'è qualche problema di permessi (non credo, perché ho tutti i permessi di lettura necessari... e non funza nemmeno da root)?
In sintesi. Come faccio a leggere un file nella directory /proc con un programma C o C++?!?
__________________
Bjarne Stroustrup: "I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone."
Andrew S. Tanenbaum: "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway."
Edsger Dijkstra: "Computer Science is no more about computers than astronomy is about telescopes."
Robert Firth: "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs."
Donald Knuth: "A mathematical formula should never be 'owned' by anybody! Mathematics belong to God."
|