home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10297 < prev    next >
Encoding:
Text File  |  1992-08-22  |  1.8 KB  |  46 lines

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