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 8 2351
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. 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
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
"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 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
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
"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"
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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.
...
|
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...
|
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...
|
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:
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |