Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

howto create a filesystem like /proc?

I would like to create a pseudo filesystem like /proc to access an applications configuration.

How could i achieve this or where could i find some introductory documentation about it?

like image 893
matthias krull Avatar asked Jun 15 '10 11:06

matthias krull


People also ask

What type of file system is proc?

3.1. Under Linux, all data are stored as files. Most users are familiar with the two primary types of files: text and binary. But the /proc/ directory contains another type of file called a virtual file. It is for this reason that /proc/ is often referred to as a virtual file system.

Is proc a virtual file system?

As such, /proc is an example of a virtual file system. Most virtual files are listed as zero bytes in size, but they contain a large amount of information when viewed. Virtual files such as /proc/interrupts , /proc/meminfo , /proc/mounts , and /proc/partitions provide a view of the system's hardware.

Why is proc a pseudo filesystem?

The proc file system is sometimes referred to as a process information pseudo-file system. It does not contain ``real'' files but rather runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information center for the kernel.


2 Answers

The easiest way is to use FUSE. This is particularly easy with high-level language bindings, such as fuse-python.

like image 52
Marcelo Cantos Avatar answered Oct 09 '22 00:10

Marcelo Cantos


Perhaps you want to have a look at sysfs

like image 36
Daniel Băluţă Avatar answered Oct 08 '22 23:10

Daniel Băluţă