[darcs-devel] (seeking unix advice) Bug#304264: Patch for ignoring sockets

Florian Weimer fw at deneb.enyo.de
Fri Jul 29 04:08:10 PDT 2005


* David Roundy:

> I'd like to have comments on this patch, which is intended to make darcs
> ignore sockets when slurping.  It sounds like a good idea to me, but I was
> hoping that someone with longer unix experience than I could comment on its
> advasability and implementation.

I'd recommend checking for the S_IFREG (regular file) bit.  This
should be more portable.  The POSIX bits are documented at:

<http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html>

Keep in mind that many systems in the field only provide some
approximation to POSIX.  However, I think the S_IFREG field should be
reasonably widespread.  In this case, the function should be called
"isFileReallyFile", and not "isFileReallySocket", of course.

It might be necessary to special-case symlinks, though.  This depends
on the callers.




More information about the darcs-devel mailing list