Is it practical to get a R/W file handle opened against an existing file on an unmounted ext2 filesystem? -- Chuck Wolber Electronic Flight Bag Crew Information Systems/ Linux Wonk 253.576.1154 "You can't connect the dots looking forward; you can only connect them looking backwards." --Steve Jobs
On Fri, Sep 23, 2005 at 04:11:27PM -0700, EXT-Wolber, Richard wrote:> Is it practical to get a R/W file handle opened against an existing file > on an unmounted ext2 filesystem?What do you mean by a "read/write file handle"? Do you mean opening a file descriptor using the open(2) system call? Do you mean opening a stdio stream handle using the fopen(3) library call? In either case, no, you can can only open() or fopen() a file on a mounted filesystem, and it doesn't matter which filesystem you are using. There are a set of interfaces as part of the ext2fs library which would allow you to manipulate a file on an unmounted filesystem. - Ted
On Fri, Sep 23, 2005 at 04:11:27PM -0700, EXT-Wolber, Richard wrote:> > Is it practical to get a R/W file handle opened against an existing > > file on an unmounted ext2 filesystem? > > What do you mean by a "read/write file handle"?As you noted below, I wish to manipulate files on an unmounted filesystem. Specifically, I wish to send log messages to a file in an unmounted Filesystem.> There are a set of interfaces as part of the ext2fs library whichwould allow> you to manipulate a file on an unmounted filesystem.What are the cons to doing this? Performance isn't that big of an issue in our application. The whole point is to avoid mounting a filesystem in a very unfriendly environment. Power is expected to fluctuate at random intervals. It is permissible to have incomplete writes, but it is not permissable for the filesystem or files to be corrupted such that it cannot later be mounted and reviewed. What do you recommend? ..Chuck..