Skip to main content

The /proc filesystem is a so-called "pseudo filesystem", meaning that (afaiu) there is no spoon^H^H^Hdiskdisk usage.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...

The /proc filesystem is a so-called "pseudo filesystem", meaning that (afaiu) there is no spoon^H^H^Hdisk.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...

The /proc filesystem is a so-called "pseudo filesystem", meaning that (afaiu) there is no disk usage.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...

oops
Source Link
wzzrd
  • 3.8k
  • 26
  • 19

The /proc filesystem is a so-called "virtual"pseudo filesystem", meaning that (afaiu) there is no spoon^H^H^Hdisk.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...

The /proc filesystem is a so-called "virtual filesystem", meaning that (afaiu) there is no spoon^H^H^Hdisk.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...

The /proc filesystem is a so-called "pseudo filesystem", meaning that (afaiu) there is no spoon^H^H^Hdisk.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...

Source Link
wzzrd
  • 3.8k
  • 26
  • 19

The /proc filesystem is a so-called "virtual filesystem", meaning that (afaiu) there is no spoon^H^H^Hdisk.

I'm not quite sure how this works at the lowest level, so I may be wrong, but here goes. If I run

f = open('/proc/meminfo')
f.read()
f.seek(0)
f.read()

I get two different outputs. Afaik, seek(0) only resets the read offset and it doesn't re-open the file. This suggests that re-reading a file is enough to get the new values.

That said, if you are developing for Linux, getting permanent access to Linux box seems a pretty logical thing to do...