LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2009, 09:55 PM   #1
bitzsk
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Rep: Reputation: 0
How to get the block numbers of a file ?


hi , everyone.

i want to get the block numbers of a file. Could you tell me which function can i use?

thanx!
 
Old 06-03-2009, 10:13 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
Any particular language?
 
Old 06-03-2009, 10:19 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by bitzsk View Post
hi , everyone.
i want to get the block numbers of a file.
Why???!!!

"stat" will give you the inode #, and lots of other info.
 
Old 06-03-2009, 10:41 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
http://books.google.com/books?id=cbb...um=3#PPA738,M1
 
Old 06-04-2009, 12:08 AM   #5
bitzsk
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jamescondron View Post
Any particular language?
use C language ,both in linux userspace or kernelspace is ok
 
Old 06-04-2009, 12:09 AM   #6
bitzsk
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
Why???!!!

"stat" will give you the inode #, and lots of other info.
because i want to do this for security purpose of xen VM.
 
Old 06-04-2009, 12:15 AM   #7
bitzsk
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
thank you for the reference. but i can't find the specific way to do this.
 
Old 06-05-2009, 07:36 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by bitzsk View Post
thank you for the reference. but i can't find the specific way to do this.
In your other recent thread, you obviously found the answer: filefrag (part of e2fsprogs)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File serial numbers exvor Programming 4 07-20-2007 04:57 PM
File system magic numbers bgbranko Linux - General 5 09-23-2006 04:37 PM
numbers as file owners stabu Linux - General 3 04-27-2004 12:29 PM
Checking a file for numbers chrisk5527 Linux - General 1 09-12-2003 08:50 AM
file version numbers tjones11 Programming 2 03-15-2002 12:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration