home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!ucselx!newshub.sdsu.edu!saturn!wang
- From: wang@saturn.sdsu.edu (Luqing Wang)
- Subject: ??? about i-nodes and file system
- Message-ID: <1992Aug22.164026.10911@newshub.sdsu.edu>
- Sender: news@newshub.sdsu.edu
- Nntp-Posting-Host: saturn
- Organization: San Diego State University, College of Sciences
- X-Newsreader: Tin 1.1 PL5
- Date: Sat, 22 Aug 1992 16:40:26 GMT
- Lines: 33
-
- Dear netters,
-
- Right now I am worrking on a project which require to deal with a file's
- disk block number directly. Is there any existing system calls which can
- get a file inode structure, and the disk blocks allocated to a file?
-
- I did this using ram i/o(treat disk as a file); First get the inode number
- of the file, then compute the disk absolute address of the inode, then
- read in the disk inode structrre. From the inode , one can easily find the
- disk block allocateion. However, this method has a deadly drawback, it
- totally bypassed the unix file system, if the kernel has not write the
- recnet change of the file's inode information to disk, the program will
- get wrong infromation.
-
- Any idea to get around this ? Or is there a way to force the unix OS to
- write all bufferd information(inodes information) to disk? I tried to use
- sync from console, it does not work. Only thing I found worked so far is
- to shutdown the system, then reboot, this will force the system write most
- recent change to the disk. Obvious I can not do this in a program.
-
- I am working SUN OS4.1
-
- Any suggestionis highly appreciated.
-
- Luqing
-
-
-
- --
- .-. ^^*^^ ;;;_ || %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- ( o ) ~~&_/~* || San Diego State University
- ;. & \ _ *___~.~.~. ^ __ || Internet: wang@saturn.sdsu.edu
- Y/ $$$ \&/ _-_-_- _-==- *** - +++ |||||||||||||||||||||||||||||||
-