Thread (6 messages) 6 messages, 3 authors, 2011-02-15

directory entry

From: mohit verma <hidden>
Date: 2011-02-15 18:04:29

thanks guys....

On Tue, Feb 15, 2011 at 10:56 PM, Manish Katiyar [off-list ref] wrote:
On Tue, Feb 15, 2011 at 3:47 AM, mohit verma [off-list ref]
wrote:
quoted
thanks rajat  but i need it in kernel space.
In the kernel space too idea would be same. You get the directory's
page and depending on the filesystem you advance by a particular
offset in that page. For example look at ext2_readdir() and how it
finds the next entry by
incrementing offsets by ext2_rec_len_from_disk() .

quoted
On Tue, Feb 15, 2011 at 5:00 PM, Rajat Sharma [off-list ref]
wrote:
quoted
quoted
well just do a readdir and count yourself where you find a match!!

-Rajat

On Tue, Feb 15, 2011 at 4:44 PM, mohit verma [off-list ref]
wrote:
quoted
hi all,
is there any way to find out the offset or the directory entry number
of
quoted
quoted
quoted
a
file in the directory ?

let me explain a bit more:

when we open a drectory via open(2) and find out the directory entry
by
quoted
quoted
quoted
readdir(2,3) or getdents(2) it automatically increases to the next
directory entry and fills in the dirent structure.
but in kernel space , let we have the parent directory name and child
of
quoted
quoted
quoted
it
. so is there any way to figure out at what  offset or what number
(exactly)
that perticular child will occur in the directory contains?

--
........................
MOHIT VERMA

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


--
........................
MOHIT VERMA

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


--
Thanks -
Manish


-- 
........................
*MOHIT VERMA*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110215/6189e677/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help