wildcards in rename()?

A

Alvaro Puente

Hi all!

Do any of you know if wildcards are accepted when calling rename()
function?

Thanks/Alvaro
 
J

Joona I Palaste

Alvaro Puente said:
Do any of you know if wildcards are accepted when calling rename()
function?

I'm not sure about this, but I think the ISO C standard does not
guarantee any wildcard support whatsoever. Your own implementation might
provide some but that'll be off-topic here.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"You can pick your friends, you can pick your nose, but you can't pick your
relatives."
- MAD Magazine
 
S

Scott Condit

Dan said:
What part of the description of rename() rules out the possibility of
wildcard support?
The part that refers to "...the file whose name is..." can be taken to
expressly rule out any wildcards which match more than one file ;)
What part of the description of system() guarantees wildcard support?
It doesn't, but the manner in which the command processor, if any,
executes a string passed to it is to be documented. Hence, I imagine,
the exhortation to "try system()".

S
 
J

Joona I Palaste

What part of the description of rename() rules out the possibility of
wildcard support?
What part of the description of system() guarantees wildcard support?

I tried to promise not to get into this argument, but I have to make
this point.
Let's ignore Dan's two arguments above as arguments by themselves, and
consider the fact that he made both of them together.
Dan is saying that it is implementation-dependent whether rename() and
system() support wildcards. Note how he seems to be *advocating* the use
of wildcards in rename() because of this, and *disadvocating* the use of
wildcards in system() because of this.
Why? What makes one implementation-dependent behaviour better than
another? Why couldn't it just as easily be the other way around?

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"It's time, it's time, it's time to dump the slime!"
- Dr. Dante
 
E

Eric Sosman

Dan said:
What part of the description of rename() rules out the possibility of
wildcard support?


What part of the description of system() guarantees wildcard support?

What part of "try" says "guarantee?"
What happens if more than one file matches the wildcards?

Whatever the implementation says should happen.

system ("rename *.new *.old");

.... has/had perfectly well-defined behavior on (Open)VMS,
for example.
 
M

Mark McIntyre

No part, and thats not precisely what Joona said. What _is_ your
problem? Why not simply augment Joona's response helpfully?
I'm not getting into this kind of argument again... =)
 
J

Joona I Palaste

No part, and thats not precisely what Joona said. What _is_ your
problem? Why not simply augment Joona's response helpfully?

Um, Mark, Dan's arguing with Emmanuel Delahaye here, not with me.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Nothing lasts forever - so why not destroy it now?"
- Quake
 
D

Dan Pop

In said:
I tried to promise not to get into this argument, but I have to make
this point.
Let's ignore Dan's two arguments above as arguments by themselves, and
consider the fact that he made both of them together.
Dan is saying that it is implementation-dependent whether rename() and
system() support wildcards. Note how he seems to be *advocating* the use
of wildcards in rename() because of this, and *disadvocating* the use of
wildcards in system() because of this.

Don't be idiot! I wasn't advocating anything at all! Merely pointing
out that this is entirely an implementation-specific issue, therefore
Emmanuel's advice was bogus (in the context of this newsgroup).

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top