glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU - Unix

This is a discussion on glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU - Unix ; I am porting from Digital Unix to Linux (RHEL 4), and am seeing a difference in the return value of glob(). Given a non-existant directory "/tmp/a", and the following line of code: result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo); - result ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

  1. glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    difference in the return value of glob().
    Given a non-existant directory "/tmp/a", and the following line of
    code:
    result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    - result is set to GLOB_NOMATCH on both platforms.

    However, if the first parameter is changed to "/tmp/a/*", i.e.
    searching for files within the directory, the return value on Digital
    Unix is still GLOB_NOMATCH, but on RHEL it is GLOB_ABORTED (2)

    Which is correct?
    (I have seen the man page, and some Google matches mentioning earlier
    Linux bugs, but am still confused!)

    TIA
    Mark


  2. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    On 5 Jun, 14:45, mark.berg...@thales-is.com wrote:
    > I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    > difference in the return value of glob().
    > Given a non-existant directory "/tmp/a", and the following line of
    > code:
    > result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    > - result is set to GLOB_NOMATCH on both platforms.
    >
    > However, if the first parameter is changed to "/tmp/a/*", i.e.
    > searching for files within the directory, the return value on Digital
    > Unix is still GLOB_NOMATCH, but on RHEL it is GLOB_ABORTED (2)
    >
    > Which is correct?
    > (I have seen the man page, and some Google matches mentioning earlier
    > Linux bugs, but am still confused!)


    This is probably better addressed in comp.unix.programmer, as
    comp.lang.c tends not to concern itself with behaviour outside the C
    standards.

    However, http://www.opengroup.org/onlinepubs/...ions/glob.html
    (the relevant part of the relevant standard) was easy to find and
    suggests to me that the RHEL behaviour is correct.





  3. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    mark.bergman@thales-is.com wrote:
    >
    > I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    > difference in the return value of glob().
    > Given a non-existant directory "/tmp/a", and the following line of
    > code:
    > result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    > - result is set to GLOB_NOMATCH on both platforms.
    >
    > However, if the first parameter is changed to "/tmp/a/*", i.e.
    > searching for files within the directory, the return value on Digital
    > Unix is still GLOB_NOMATCH, but on RHEL it is GLOB_ABORTED (2)
    >
    > Which is correct?
    > (I have seen the man page, and some Google matches mentioning earlier
    > Linux bugs, but am still confused!)


    Who knows. You didn't post the code for glob().

    --




    cbfalconer at maineline dot net



    --
    Posted via a free Usenet account from http://www.teranews.com


  4. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    On 2007-06-05, CBFalconer wrote:
    > mark.bergman@thales-is.com wrote:
    >>
    >> I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    >> difference in the return value of glob().
    >> Given a non-existant directory "/tmp/a", and the following line of
    >> code:
    >> result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    >> - result is set to GLOB_NOMATCH on both platforms.
    >>
    >> However, if the first parameter is changed to "/tmp/a/*", i.e.
    >> searching for files within the directory, the return value on Digital
    >> Unix is still GLOB_NOMATCH, but on RHEL it is GLOB_ABORTED (2)
    >>
    >> Which is correct?
    >> (I have seen the man page, and some Google matches mentioning earlier
    >> Linux bugs, but am still confused!)

    >
    > Who knows. You didn't post the code for glob().


    man glob:


    GLOB(3) Linux Programmer's Manual GLOB(3)


    NAME
    glob, globfree - find pathnames matching a pattern, free memory
    from glob()


    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  5. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    "Chris F.A. Johnson" wrote:
    > On 2007-06-05, CBFalconer wrote:
    >> mark.bergman@thales-is.com wrote:
    >>>
    >>> I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    >>> difference in the return value of glob().
    >>> Given a non-existant directory "/tmp/a", and the following line of
    >>> code:
    >>> result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    >>> - result is set to GLOB_NOMATCH on both platforms.
    >>>
    >>> However, if the first parameter is changed to "/tmp/a/*", i.e.
    >>> searching for files within the directory, the return value on Digital
    >>> Unix is still GLOB_NOMATCH, but on RHEL it is GLOB_ABORTED (2)
    >>>
    >>> Which is correct?
    >>> (I have seen the man page, and some Google matches mentioning earlier
    >>> Linux bugs, but am still confused!)

    >>
    >> Who knows. You didn't post the code for glob().

    >
    > man glob:
    >
    > GLOB(3) Linux Programmer's Manual GLOB(3)
    >
    > NAME
    > glob, globfree - find pathnames matching a pattern, free memory
    > from glob()


    That is not the code for glob(). I see no mention of Linux in the
    C standard. Nor of glob(). Nor of pathnames.

    --




    cbfalconer at maineline dot net



    --
    Posted via a free Usenet account from http://www.teranews.com


  6. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    mark.bergman@thales-is.com wrote:
    >
    > I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    > difference in the return value of glob().
    > Given a non-existant directory "/tmp/a", and the following line of
    > code:
    > result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    > - result is set to GLOB_NOMATCH on both platforms.


    In my earlier reply I didn't notice the cross-post, and neglected
    to set follow-ups. Done here.

    --




    cbfalconer at maineline dot net



    --
    Posted via a free Usenet account from http://www.teranews.com


  7. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    On 2007-06-06, CBFalconer wrote:
    > "Chris F.A. Johnson" wrote:
    >> On 2007-06-05, CBFalconer wrote:
    >>> mark.bergman@thales-is.com wrote:

    ....
    >>> Who knows. You didn't post the code for glob().

    >>
    >> man glob:
    >>
    >> GLOB(3) Linux Programmer's Manual GLOB(3)
    >>
    >> NAME
    >> glob, globfree - find pathnames matching a pattern, free memory
    >> from glob()

    >
    > That is not the code for glob(). I see no mention of Linux in the
    > C standard. Nor of glob(). Nor of pathnames.


    This is comp.os.linux.misc, not comp.lang.c, so that is
    irrelevant.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  8. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    On 2007-06-06, CBFalconer wrote:
    > mark.bergman@thales-is.com wrote:
    >>
    >> I am porting from Digital Unix to Linux (RHEL 4), and am seeing a
    >> difference in the return value of glob().
    >> Given a non-existant directory "/tmp/a", and the following line of
    >> code:
    >> result = glob("/tmp/a", GLOB_ERR, NULL, &globInfo);
    >> - result is set to GLOB_NOMATCH on both platforms.

    >
    > In my earlier reply I didn't notice the cross-post, and neglected
    > to set follow-ups. Done here.


    Same here. Sorry.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  9. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    "Chris F.A. Johnson" writes:
    > On 2007-06-06, CBFalconer wrote:

    [...]
    >> That is not the code for glob(). I see no mention of Linux in the
    >> C standard. Nor of glob(). Nor of pathnames.

    >
    > This is comp.os.linux.misc, not comp.lang.c, so that is
    > irrelevant.


    It's both, as well as comp.unix.programmer. The message was
    (inappropriately) cross-posted.

    --
    Keith Thompson (The_Other_Keith) kst-u@mib.org
    San Diego Supercomputer Center <*>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

  10. Re: glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

    "Chris F.A. Johnson" wrote:
    > On 2007-06-06, CBFalconer wrote:
    >> "Chris F.A. Johnson" wrote:
    >>> On 2007-06-05, CBFalconer wrote:
    >>>> mark.bergman@thales-is.com wrote:

    > ...
    >>>> Who knows. You didn't post the code for glob().
    >>>
    >>> man glob:
    >>>
    >>> GLOB(3) Linux Programmer's Manual
    >>>
    >>> NAME
    >>> glob, globfree - find pathnames matching a pattern, free
    >>> memory from glob()

    >>
    >> That is not the code for glob(). I see no mention of Linux in the
    >> C standard. Nor of glob(). Nor of pathnames.

    >
    > This is comp.os.linux.misc, not comp.lang.c, so that is irrelevant.


    No, if you look at the cross-posts you will see it is also c.l.c.
    Follow-ups have been set.

    --




    cbfalconer at maineline dot net



    --
    Posted via a free Usenet account from http://www.teranews.com


+ Reply to Thread