Hi Pintu, On Sat, 22 Oct 2011, Pintu Kumar wrote:
> I already did some work for scanning only top level directory in vvfat. > Using the following logic in read_directory() > > if(parent_index >= 0 & (!dot & !dotdot)) > { > free(buffer); > break; > } Sorry, this is way too deep in the code (and I'd have to guess because you did not grace me with exact locations), I cannot afford to dive into it that far. But what I can say is that it is not all that easy; you'll need to refactor the code. You _will_ need to reserve sectors for future directory parsing. You _will_ need to add code that intercepts reads to those sectors. You _will_ have to read the directories in question when those sectors are accessed and thereby commit the sectors to a final state. BTW both Kevin and I said that before. > Hope this is correct logic for skipping sub-directories content by just > scanning only dot and dotdot entries inside it. It would be, if all you want are empty directories. > But as per the recent analysis it was observed that there is some > problem in skipping sub-directory scanning itself. Because when I issue > "df" command on VVFAT partition I get read_cluster errors during these > sector location. When you issue "df", you need to commit to which sectors are reserved. By that, you take almost all the advantage of lazy directory parsing away. > Mr. Johannes, can you clarify on this first. > > Then we will look into the dynamic mapping part later. I am very sorry, but I do get the impression that the intent is to lure me into doing all the work, including the investigation what it would take to turn the code into a version that reads just the top-level first and only later the subdirectories. This will not happen. I have enough projects that I want to tackle myself, and I am extremely unwilling to do the work for somebody else when that somebody else is paid to do the work. For the things I _want_ to do I already have too little time, given that my day job is quite demanding and asks software design and architecture of me already. So: you _will_ have to acquaint yourself with the FAT and then the VFAT specification. You _will_ have to make a proper plan how the client may be fooled into believing that there is a fixed filesystem when there is actually just directories of files. And you _will_ have to write that code yourself. I hope this clarified it? Ciao, Johannes