From: "Vineet Joglekar" <vintya@excite.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: To Charlie : How to allocate few bytes to a file automatically after creating it?
Date: Fri, 14 May 2004 11:52:06 -0400 (EDT) [thread overview]
Message-ID: <20040514155206.047A81BCFC@xprdmailfe23.nwk.excite.com> (raw)
my goal is to store some metadata in a file as soon as its created. I am trying to make some changes in the file system, so it has to be at the file system level. User need not know that i am writing this matadata to every file created. so the picture is like when an inode is created for the new file, 1st entry in the data block pointers should be valid with some info in the allocated data block.
Thanks and regards,
Vineet
>If your goal is to make sure the file is non empty, with >correct contents, as soon as it appears in the file system, the >classical method is to create a new file with a temporary name >with open(), write appropriate contents to it with write(), >close it, and then rename it to the correct name with rename(), >an atomic change to most file systems. The only constraint is >that the file be created in the same file system.If this >doesn't solve your problem, what did I miss ?
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
reply other threads:[~2004-05-14 15:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040514155206.047A81BCFC@xprdmailfe23.nwk.excite.com \
--to=vintya@excite.com \
--cc=linux-c-programming@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).