Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8602277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:02:44+00:00 2026-06-12T02:02:44+00:00

Dupe on stackoverflow by one of my friends having the same problem: I copied

  • 0

Dupe on stackoverflow by one of my friends having the same problem:

I copied the code from this tutorial: http://www.thegeekstuff.com/2012/04/create-proc-files/

And made the module which created my procfile.

I was happy to find that I gained a procfile I could echo “text” > proc/name_of_procfile

I can also read with cat!!

I’ve been fooling with it and now have a sizable number of values in my procfile – whenever I cat it goes through these values sequentially:

Q1.I wonder – how do I delete values from the procfile?

ALSO, later, I am going to try to get the behavior that whenever a file reads my procfile, it changes the value of whatever it just read in the proc_file.

Q2. I know this would be implemented in my “int read_info” method, but any pointers on how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:02:46+00:00Added an answer on June 12, 2026 at 2:02 am

    Q1.

    You can’t delete these values in a normal sense of a delete operation on a file system. You may echo something into procfile if it is writable. Then it depends on a module’s behavior how this ‘incoming’ data is treated. Will it be stored or discarded or in any way accounted somehow internally – the module decides. To be more precise, the logic that you put into module defines the treatment. The module from this example has very simple logic: it memorizes a string in its internal buffer when the kernel calls its write_info function – actually it does concatenate a new data with the current content. Then it can return the content of this buffer when kernel calls its read_info function. So if you do:

    echo "some text">/proc/yourprocfile
    echo "another text">/proc/yourprocfile
    

    Then cat /proc/yourprocfile would print

    some text
    another text
    

    on the screen.
    To summarize: the complete behavior of these files is module-defined.

    Q2.

    You could do this nearly like you do this in the usual C program. There are two major differences:

    • the API accessible in the kernel mode is different. Some functions have the same or very similar names and functionality as their analogues in standard C library has. The other functions have different names but still analogous to some user-space functions. And then, some specific functions that are available only in kernel space.

    • everything you do in kernel space should be several times checked by you and debugged on the sheet of paper as any bug in your module may cause kernel core dump at a minimum (kernel just stops and then you have to press reset button to reboot your system) and may cause data corruption of your file systems at worst.

    So, I would recommend you to set up the VirtualBox package; to create with this beautiful tool a virtual machine; to install there the minimal linux version and to make a snapshot of it’s virtual disk after installation. So if something goes wrong you always may revert any damage. You need not to install all your build tools and kernel source there – you will be only loading and testing/debugging your modules/applications on this virtual machine.

    But anyway, the area that you are going to touch, or, to be more correct, already touched, is very interesting one.

    Good luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this isn't a dupe, but it's hard to boil down the problem
This is a dupe from SuperUser.com . Folks over there weren't smart enough or
Before you say that it is a dupe, this is not the same as
Before I get marked as dupe of articles like: [http://stackoverflow.com/questions/635123/what-is-a-good-tool-or-site-to-use-to-performance-test-a-web-page-site][1] Most of the answers
This is not a dupe of Calling a method with ref or out parameters
Sorry if this is a dupe. There are many similar questions but it seems
Hope this is not a dupe. I would like to be able to do
Please do not mark it as a dupe of this question just yet: Bold
Hopefully this isn't a dupe, couldn't find anything related online I'm getting a strange
i have a list of lists that looks like this: dupe = [['95d1543adea47e88923c3d4ad56e9f65c2b40c76', 'ron\\c',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.