Mail Archives: cygwin/2006/04/12/11:39:54
On Apr 12 11:48, Corinna Vinschen wrote:
> On Apr 11 15:45, Stefan Vorkoetter wrote:
> > And here's one from a Samba 2.2.3a share, repeated twice. Notice the inodes
> > are different each time.
> >
> > ~/sandboxes/main/internal/src [920] $ ls -i
> > v:/internal_html/2006-04-10/*.jpg
> > 3796172808 v:/internal_html/2006-04-10/17-50-56.jpg
> > [...]
>
> I have a vague hope. It really looks like the inode numbers sent by
> older Samba versions are 32 bit values, which would allow to distinguish
> between old and new versions.
>
> Would you or anybody with an older Samba version mind to look into
> more directories on the share and try to figure out if the inode number
> is always smaller than UINT_MAX (4294967295)? I just need a feedback
> of yes or no.
Btw., I have hacked together a tiny testcase which lists a directory and
evaluates the inode numbers using readdir and lstat. I would be
interested to see the output for some smaller directories on shares
using pre-3.0 Samba versions. This should also simplify testing in
general.
Corinna
======================== SNIP =====================
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
DIR *dirp;
int fd;
struct stat sb;
struct dirent *d;
if (argc > 1)
{
dirp = opendir(argv[1]);
if (dirp)
{
while (d = readdir (dirp))
{
char buf[256];
struct stat st;
strcpy (buf, argv[1]);
if (buf[strlen (buf) - 1] != '/')
strcat (buf, "/");
strcat (buf, d->d_name);
lstat (buf, &st);
printf ("%24s d: %18.18llu, st: %18.18llu\n",
d->d_name, d->d_ino, st.st_ino);
}
closedir (dirp);
}
else
printf("dirp = NULL\n");
}
return 0;
}
======================== SNAP =====================
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -