bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vfat lost file problem


From: Jim Meyering
Subject: Re: vfat lost file problem
Date: Mon, 18 Aug 2003 10:51:26 +0200

Paul Eggert <address@hidden> wrote:
> On POSIX hosts, that can happen only if the file names are silently
> truncated, right?  I.e., if _POSIX_NO_TRUNC is zero.  Does anybody
> still use hosts like that?  If so, here's a patch.  This patch won't
> fix any Debian behavior, since _POSIX_NO_TRUNC is 1 on Debian, but it
> would help on _POSIX_NO_TRUNC==0 hosts.
>
> Perhaps a similar patch could be used for vfat filesystems.  That is,
> same_name could inspect the results of the stat system calls to see
> whether the files live on a vfat filesystem.  I don't know all the ins
> and outs of vfat names, though.
>
> 2003-08-17  Paul Eggert  <address@hidden>
>
>       * same.c: Include <stdbool.h>, <limits.h>.
>         (_POSIX_NAME_MAX): Define if not defined.
>         (MIN): New macro.
>         (same_name): If file names are silently truncated, report
>         that the file names are the same if they are the same after
>         the silent truncation.

...
> +#if ! _POSIX_NO_TRUNC && HAVE_PATHCONF && defined _PC_NAME_MAX
> +      if (same && ! identical_basenames)
> +     {
> +       long name_max = (errno = 0, pathconf (source_dirname, _PC_NAME_MAX));
> +       if (name_max < 0)
> +         {
> +           if (errno)
> +             {
> +               /* Shouldn't happen.  */
> +               error (1, errno, "%s", source_dirname);
> +             }
> +           same = false;
> +         }

Thanks!  I've applied that.
But shouldn't the above two references to source_dirname
be to dest_dirname instead, because only the limits of the
destination directory are relevant?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]