Peter Eisentraut <[EMAIL PROTECTED]> writes:
> How do you find out if a directory is empty?

Good question.

> The best way I could think of is this:

> test x"`ls -A "$PGDATA"`" = x

The embedded quotes might confuse some shells, no?  Perhaps better
        CONTENTS=`ls -A "$PGDATA"`
        if test "x$CONTENTS" = x

> Are we talking 7.0.1 material, btw?

Well, we would be if we were sure of the patch.  I'm a little worried
about portability though.  Given that this isn't a very critical issue
(IMHO) I'd recommend saving it for the 7.1 cycle.

                        regards, tom lane

Reply via email to