Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > glob("/tmp/a/*") returns GLOB_ABORTED on RHEL, GLOB_NOMATCH on DU

Reply
Thread Tools

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

 
 
mark.bergman@thales-is.com
Guest
Posts: n/a
 
      06-05-2007
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

 
Reply With Quote
 
 
 
 
mark_bluemel@pobox.com
Guest
Posts: n/a
 
      06-05-2007
On 5 Jun, 14:45, (E-Mail Removed) 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.




 
Reply With Quote
 
 
 
 
Chris F.A. Johnson
Guest
Posts: n/a
 
      06-06-2007
On 2007-06-05, CBFalconer wrote:
> http://www.velocityreviews.com/forums/(E-Mail Removed) 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 | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
 
Reply With Quote
 
Chris F.A. Johnson
Guest
Posts: n/a
 
      06-06-2007
On 2007-06-06, CBFalconer wrote:
> "Chris F.A. Johnson" wrote:
>> On 2007-06-05, CBFalconer wrote:
>>> (E-Mail Removed) 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 | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      06-06-2007
"Chris F.A. Johnson" <(E-Mail Removed)> 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) (E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorted Returns List and Reversed Returns Iterator ++imanshu Python 7 08-23-2008 04:25 AM
Hash#select returns an array but Hash#reject returns a hash... Srijayanth Sridhar Ruby 19 07-02-2008 12:49 PM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
block returns and hash element returns Trans Ruby 2 11-06-2005 12:15 PM
Device search returns devices with zero length strings =?Utf-8?B?U3RlcGhlbiBJbmtwZW4=?= Wireless Networking 2 07-15-2005 12:26 AM



Advertisments