473,545 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jun 5 '07 #1
8 2360
On 5 Jun, 14:45, mark.berg...@th ales-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.progr ammer, 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
ma**********@th ales-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.securityfoc us.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
On 2007-06-05, CBFalconer wrote:
ma**********@th ales-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
"Chris F.A. Johnson" wrote:
On 2007-06-05, CBFalconer wrote:
>ma**********@th ales-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.securityfoc us.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
ma**********@th ales-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.securityfoc us.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
On 2007-06-06, CBFalconer wrote:
"Chris F.A. Johnson" wrote:
>On 2007-06-05, CBFalconer wrote:
>>ma**********@th ales-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.m isc, 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
"Chris F.A. Johnson" <cf********@gma il.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.m isc, not comp.lang.c, so that is
irrelevant.
It's both, as well as comp.unix.progr ammer. The message was
(inappropriatel y) cross-posted.

--
Keith Thompson (The_Other_Keit h) 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
"Chris F.A. Johnson" wrote:
On 2007-06-06, CBFalconer wrote:
>"Chris F.A. Johnson" wrote:
>>On 2007-06-05, CBFalconer wrote:
ma**********@th ales-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.m isc, 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.securityfoc us.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1492
by: ralawrence | last post by:
Hi there, Funny question this, but the server my website is on is currently undergoing changes/updates and for a short period of time the version of PHP has gone back to 4.2.2. This means that "glob" doesn't work (as i'm told it was introduced in 4.3.0) and so some of the pages on my website are breaking. Rather than wait for it to be...
4
3427
by: Python Dunce | last post by:
I've run into an issue with glob and matching filenames with brackets '' in them. The problem comes when I'm using part of such a filename as the path I'm passing to glob. Here's a trimmed down dumb example. Let's say I have a directory with the following files in it. foo.par2 foo.vol0+1.par2 foo.vol1+1.par2 zzz .par2 zzz .vol0+1.par2
1
7512
by: Tony | last post by:
Hello All, I'm having difficulty in using the glob function with stat. Here is a simple piece of code – ----------------------------------------------------------- #! /usr/bin/perl -w use File::Glob; use File::stat;
1
2344
by: lemke_juergen | last post by:
Hi everyone, I define some vars and functions in a "support" module which gets called from my main app module. Using Python 2.5. I import all symbols in the support module at the top of the main module through: from support import *
8
8446
by: Neil Webster | last post by:
Hi, I was wondering whether anybody could help me out. I have a program, for part of it I am trying to pass a variable to a glob function, this returns an empty list. The strange thing is when I hard code in the variable the glob section works. Does anybody have any ideas as why it is not working?
0
1517
by: Adam | last post by:
Hello, I have a small app I am creating to crawl a directory and check that if it is moved to another a location it's path will not break a character limit. Usually the Windows path limit. Now the script is working but every time I want to scan again I have to restart for the log files to be written. I want to just be able to change the...
5
2398
by: jo3c | last post by:
hi everyone happy new year! im a newbie to python i have a question by using linecache and glob how do i read a specific line from a file in a batch and then insert it into database? because it doesn't work! i can't use glob wildcard with linecache
7
9395
by: dieter | last post by:
Hi, Overview ======= I'm doing some simple file manipulation work and the process gets "Killed" everytime I run it. No traceback, no segfault... just the word "Killed" in the bash shell and the process ends. The first few batch runs would only succeed with one or two files being processed (out of 60) before the process was "Killed". Now...
4
1483
by: John [H2O] | last post by:
I have a glob.glob search: searchstring = os.path.join('path'+'EN*') files = glob.glob(searchstring) for f in files: print f ___ This returns some files:
0
7425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7935
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7449
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.