473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

fnmatch() is not working ...

in win32 installation... is it compiled with it or this is a missing
features? Thanks
Jul 17 '05 #1
13 2744
Ruby Tuesdays wrote:
in win32 installation... is it compiled with it or this is a missing
features? Thanks


http://www.php.net/fnmatch

<quote>
*Warning*

For now this function is not available on Windows or other non-POSIX
compliant systems.
</quote>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Thanks Pedro, what's the alternative?

imagename can be of the following:

A.bmp
A.tiff
A dark.tif
A lite.bmp
AB.jpg
AB.tif
BB.bmp
BB.jpg
BB.png
BB topleft.png
BB topleft.jpg
GA.png
GA cropped.gif
GA cropped.jpg
BB lowerright.jpg
BB lowerright.gif
etc...

If I know full/partial name(First of 1-2 characters) of the image name, and
the type could be in the following(1st one is the highest priority): png,
jpg, bmp, tif, gif

if exist <fullname>.png then display image
else if exist <fullname>.jpg then display image
else if exist <fullname>.bmp then display image
else if exist <fullname>.tif then display image
else if exist <fullname>.gif then display image
else if exist <first match of partial name>.png then display image
else if exist <first match of partial name>.jpg then display image
else if exist <first match of partial name>.bmp then display image
else if exist <first match of partial name>.tif then display image
else if exist <first match of partial name>.gif then display image
else display no-image.jpg

How do I search a directory efficiently(sub-folder search would be nice but
not necessary for now).

Thanks.
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
Ruby Tuesdays wrote:
in win32 installation... is it compiled with it or this is a missing
features? Thanks


http://www.php.net/fnmatch

<quote>
*Warning*

For now this function is not available on Windows or other non-POSIX
compliant systems.
</quote>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--

Jul 17 '05 #3
[Please do not top post]
Ruby Tuesdays top-posted (corrected):
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
Ruby Tuesdays wrote:
> in win32 installation... is it compiled with it or this is a missing
> features? Thanks
http://www.php.net/fnmatch

Thanks Pedro, what's the alternative?


One of the function on the fnmatch() manual page might do what you want.
Or, at least, get you started with a solution.

If you run into problems, post the code you made so far.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #4
Thanks again Pedro.

I try to get the example in the manual to work, but no luck. As you said, it
might not be implemented during the compilation....BTW: I'm using the Win32
version.

Perhaps you know other alternative. Thanks

"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
[Please do not top post]
Ruby Tuesdays top-posted (corrected):
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
Ruby Tuesdays wrote:
> in win32 installation... is it compiled with it or this is a missing
> features? Thanks

http://www.php.net/fnmatch

Thanks Pedro, what's the alternative?


One of the function on the fnmatch() manual page might do what you want.
Or, at least, get you started with a solution.

If you run into problems, post the code you made so far.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--

Jul 17 '05 #5
[Please do not top post]
Ruby Tuesdays top-posted again (corrected again):
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
[Please do not top post]
Ruby Tuesdays top-posted (corrected):
> what's the alternative?


One of the function on the fnmatch() manual page might do what you want.
Or, at least, get you started with a solution.

If you run into problems, post the code you made so far.


I try to get the example in the manual to work, but no luck. As you said, it
might not be implemented during the compilation....BTW: I'm using the Win32
version.

Perhaps you know other alternative. Thanks


The manual hints at glob()
which hints at opendir(), readdir(), closedir()

What did you try with any of these (or other) functions?
If you run into problems, post the code you made so far.

Please do not top post. It makes threads difficult to follow.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #6
Hi Pedro, I thought I test it first before I did what you suggested.
I can't even get this to work... on win32 binaries. Thanks

<?php
$color = "gray";
if (fnmatch("*gr[ae]y", $color)) {
echo "some form of gray ...";
}
?>
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
[Please do not top post]
Ruby Tuesdays top-posted again (corrected again):
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
[Please do not top post]
Ruby Tuesdays top-posted (corrected):
> what's the alternative?

One of the function on the fnmatch() manual page might do what you want. Or, at least, get you started with a solution.

If you run into problems, post the code you made so far.


I try to get the example in the manual to work, but no luck. As you said, it
might not be implemented during the compilation....BTW: I'm using the Win32 version.

Perhaps you know other alternative. Thanks


The manual hints at glob()
which hints at opendir(), readdir(), closedir()

What did you try with any of these (or other) functions? If you run into problems, post the code you made so far.

Please do not top post. It makes threads difficult to follow.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--

Jul 17 '05 #7
[top-posting]

http://www.netmeister.org/news/learn2quote2.html

[/top-posting]

Ruby Tuesdays top-posted for the third time
(corrected for the third time):
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
[Please do not top post]
Ruby Tuesdays top-posted again (corrected again):
> "Pedro Graca" <he****@hotpop.com> wrote in message
> news:c2*************@ID-203069.news.uni-berlin.de...
>> [Please do not top post]
>> Ruby Tuesdays top-posted (corrected):
>> > what's the alternative?
>>
>> One of the function on the fnmatch() manual page might do what you
>> want.
>> Or, at least, get you started with a solution.
>>
>> If you run into problems, post the code you made so far.
>
> I try to get the example in the manual to work, but no luck. As you
> said, it might not be implemented during the compilation....
> BTW: I'm using the Win32 version.
>
> Perhaps you know other alternative. Thanks


The manual hints at glob()
which hints at opendir(), readdir(), closedir()

What did you try with any of these (or other) functions?
>> If you run into problems, post the code you made so far.


Hi Pedro, I thought I test it first before I did what you suggested.
I can't even get this to work... on win32 binaries. Thanks

<?php
$color = "gray";
if (fnmatch("*gr[ae]y", $color)) {
echo "some form of gray ...";
}
?>


"Insanity: doing the same thing over and over again and expecting
different results."
~Albert Einstein (1879 - 1955) (attributed)
Applies to both you and me :(
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #8

"Pedro Graca" <he****@hotpop.com> wrote in message
news:c3*************@ID-203069.news.uni-berlin.de...
[top-posting]

http://www.netmeister.org/news/learn2quote2.html

[/top-posting]

Ruby Tuesdays top-posted for the third time
(corrected for the third time):
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...
[Please do not top post]
Ruby Tuesdays top-posted again (corrected again):
> "Pedro Graca" <he****@hotpop.com> wrote in message
> news:c2*************@ID-203069.news.uni-berlin.de...
>> [Please do not top post]
>> Ruby Tuesdays top-posted (corrected):
>> > what's the alternative?
>>
>> One of the function on the fnmatch() manual page might do what you
>> want.
>> Or, at least, get you started with a solution.
>>
>> If you run into problems, post the code you made so far.
>
> I try to get the example in the manual to work, but no luck. As you
> said, it might not be implemented during the compilation....
> BTW: I'm using the Win32 version.
>
> Perhaps you know other alternative. Thanks

The manual hints at glob()
which hints at opendir(), readdir(), closedir()

What did you try with any of these (or other) functions?
>> If you run into problems, post the code you made so far.


Hi Pedro, I thought I test it first before I did what you suggested.
I can't even get this to work... on win32 binaries. Thanks

<?php
$color = "gray";
if (fnmatch("*gr[ae]y", $color)) {
echo "some form of gray ...";
}
?>


"Insanity: doing the same thing over and over again and expecting
different results."
~Albert Einstein (1879 - 1955) (attributed)
Applies to both you and me :(
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--


Sorry Pedro, I somehow do not understand what top post is. Now I do. Thanks.
Jul 17 '05 #9
Ruby Tuesdays wrote:
Ruby Tuesdays wrote:
> I can't even get this to work... on win32 binaries. Thanks
>
> <?php
> $color = "gray";
> if (fnmatch("*gr[ae]y", $color)) {
> echo "some form of gray ...";
> }
> ?>


Sorry Pedro, I somehow do not understand what top post is. Now I do. Thanks.


ok, no harm done :)

now ... as the manual ( http://www.php.net/fnmatch ) states the
fnmatch() function is not available on Windows.

You'll do better to forget about that and use glob() or opendir(),
readdir(), ..., closedir().
http://www.php.net/glob
http://www.php.net/opendir
Something like this (not tested):

<?php
$filelist = glob('*gr?y.txt');
echo '<pre>'; print_r(); echo '</pre>';
?>
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #10
"Ruby Tuesdays" <No**********************@yahoo.com> wrote in message news:<c3*************@ID-205437.news.uni-berlin.de>...
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c3*************@ID-203069.news.uni-berlin.de...
Hi Pedro, I thought I test it first before I did what you suggested.
I can't even get this to work... on win32 binaries. Thanks

<?php
$color = "gray";
if (fnmatch("*gr[ae]y", $color)) {
echo "some form of gray ...";
}
?>


Always, the manual and the user notes are your close friends
<http://in.php.net/fnmatch>

Read the user notes found on the page. It seems to have the
workaround for Windows.

--
"Democracy: Where all citizens are politicians and all politicians
are citizens"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #11
[Top-post fixed. Please don't top-post
<http://www.wikipedia.org/wiki/Top-post> ]

"Ruby Tuesdays" <No**********************@yahoo.com> wrote in message news:<c3*************@ID-205437.news.uni-berlin.de>...
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:ab**************************@posting.google.c om...
> > Hi Pedro, I thought I test it first before I did what you suggested.
> > I can't even get this to work... on win32 binaries. Thanks
> >
> ><?php
> > $color = "gray";
> > if (fnmatch("*gr[ae]y", $color)) {
> > echo "some form of gray ...";
> > }
> > ?>


Always, the manual and the user notes are your close friends
<http://in.php.net/fnmatch>

Read the user notes found on the page. It seems to have the
workaround for Windows.

Rajesh,
As Pedro said, the Win32 distribution does not have fnmatch() function
compiled in.


If I understand right, you didn't look at the manual
<http://in.php.net/fnmatch> and didn't read the user notes.

_or_ You don't know the meaning of "workaround":
1. http://www.onelook.com/?w=workaround
2. http://www.google.com/search?q=define:workaround

--
http://www.sendmetoindia.com - Send Me to India!
Email: rrjanbiah-at-Y!com
Jul 17 '05 #12
Rajesh,
As Pedro said, the Win32 distribution does not have fnmatch() function
compiled in.
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:ab**************************@posting.google.c om...
"Ruby Tuesdays" <No**********************@yahoo.com> wrote in message

news:<c3*************@ID-205437.news.uni-berlin.de>...
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c3*************@ID-203069.news.uni-berlin.de...
> Hi Pedro, I thought I test it first before I did what you suggested.
> I can't even get this to work... on win32 binaries. Thanks
>
><?php
> $color = "gray";
> if (fnmatch("*gr[ae]y", $color)) {
> echo "some form of gray ...";
> }
> ?>


Always, the manual and the user notes are your close friends
<http://in.php.net/fnmatch>

Read the user notes found on the page. It seems to have the
workaround for Windows.

--
"Democracy: Where all citizens are politicians and all politicians
are citizens"
Email: rrjanbiah-at-Y!com

Jul 17 '05 #13
Hi Rajesh,
if you really follow the thread, I did mention that it is not available
for Windows. Thanks to Pedro.
Jul 17 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Graeme Downes | last post by:
Hi I'm trying to create a regular expression for C using the fnmatch function from the fnmatch.h library. I dont know if you can help, but i need something as follows: #:]# where #...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
2
by: kitty | last post by:
Can anybody help me out with how to use fnmatch.h to help with regular expression use in c++ ? Also does fnmatch.h work only in linux ? Thankyou for all your help
2
by: kepioo | last post by:
Hi, I have some files in a directory : Results Log, 11;21AM, Apr 09 2006.txt Results Log, 11;21AM, Apr 08 2006.txt Results Log, 03;59AM, Apr 07 2006.txt otherfile1.txt otherfile2.txt ....
2
by: s99999999s2003 | last post by:
hi i have script like this: from fnmatch import fnmatch from glob import glob ..... .... f = r = "d:\\somepath" pat = "*.bat"
4
by: abcd | last post by:
I am using fnmatch.fnmatch to find some files. The only problem I have is that it only takes one pattern...so if I want to search using multiple patterns I have to do something like.... ...
2
by: Fabian Braennstroem | last post by:
Hi, I would like to use re to search for lines in a files with the word "README_x.org", where x is any number. E.g. the structure would look like this: ] I tried to use these kind of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
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...
0
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...
0
isladogs
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...

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.