By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,890 Members | 1,226 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,890 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jun 5 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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.


Jun 5 '07 #2

P: n/a
ma**********@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().

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

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

Jun 6 '07 #3

P: n/a
On 2007-06-05, CBFalconer wrote:
ma**********@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 | <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
Jun 6 '07 #4

P: n/a
"Chris F.A. Johnson" wrote:
On 2007-06-05, CBFalconer wrote:
>ma**********@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.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

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

Jun 6 '07 #5

P: n/a
ma**********@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.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

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

Jun 6 '07 #6

P: n/a
On 2007-06-06, CBFalconer wrote:
"Chris F.A. Johnson" wrote:
>On 2007-06-05, CBFalconer wrote:
>>ma**********@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 | <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
Jun 6 '07 #7

P: n/a
"Chris F.A. Johnson" <cf********@gmail.comwrites:
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) ks***@mib.org <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"
Jun 6 '07 #8

P: n/a
"Chris F.A. Johnson" wrote:
On 2007-06-06, CBFalconer wrote:
>"Chris F.A. Johnson" wrote:
>>On 2007-06-05, CBFalconer wrote:
ma**********@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.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net

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

Jun 6 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.