Re: [AVFS] Empty output with virt_readdir()

"Pablo" <[email protected]> Sun, 31 Jul 2005 14:01:23 -0300
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <[email protected]>
Ready, I found the problem. Here it is:



Environment:

------------

I use Slackware 9 with Anjuta as my development environment.



So to compile this little program I add 'avfs' to the "Settings->Compiler
and linker Setting-> Libraries" tab. So I _dont use_ 'avfs-config --cflags'
nor 'avfs-config --libs' to compile/build the program.





What I am doing wrong ?

-----------------------



Because I dont use 'avfs-config --cflags',

I dont get defined "_FILE_OFFSET_BITS=64".



So the system use 32bits sizes and then my structure,

"struct dirent" has 32bits

but avfs

"struct dirent" has 64bits.



So they dont match !!!!!!!!!!!!!

and I cant show the right information.



Conclusion:

-----------

Always use avfs-config.



-
  Saludos. Pablo.





----- Original Message -----
From: "Pablo" <>
To: <[email protected]>
Sent: Saturday, July 30, 2005 7:23 PM
Subject: [AVFS] Empty output with virt_readdir()


Hello, this is my first post to the list.

I am train to run this little program but it dos not show me the name of the
directories in the archive "/tmp/avfs-0.9.6.tar.gz#"

If a run it, I get this:

--------- output ------------

sizeof(dirent) = 268
2    ->
2    ->
3    ->
----------End of Output ----

I dont know why ?!! Any ideas ??


Thanks in advance.

Pablo.

Note: I am using avfs 0.9.6 compiled with:

         $
./configure --disable-preload --disable-avfscoda --enable-library --prefix=/
usr/local --enable-debug
         $ make
         # make install






--------------------- cut ----------------------------------
/* Created by Anjuta version 1.2.2 */
/* This file will not be overwritten */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

// Para AVFS
#include <virtual.h>

int main()
{
 DIR *dir = NULL;
 struct dirent* dent = NULL;

 printf("sizeof(dirent) = %d\n", sizeof(struct dirent));

 dir = virt_opendir("/tmp/avfs-0.9.6.tar.gz#");

 dent = virt_readdir(dir);
 while( dent != NULL )
 {
  printf("%d  ", (int)dent->d_ino);
  printf("-> %s\n", dent->d_name);                  // THIS SHOW NOTHING
!!???
  dent = (struct dirent*) virt_readdir(dir);
 }
 virt_closedir(dir);
 return (0);
}
--------------------- EOF ---------------------------------



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click