brakets aloud in a file name or path?

F

fatima.issawi

Hello,

Are brakets () allowed in a file path?

eg.

Passing:

Y:\trak\pdf\98-00_2_123\tst.ps works but

Y:\trak\pdf\98-00_(2)_123\tst.ps does not.

Is there any reason why it wouldn't?
Thanks,
F
 
E

Earl Purple

Hello,

Are brakets () allowed in a file path?

eg.

Passing:

Y:\trak\pdf\98-00_2_123\tst.ps works but

Y:\trak\pdf\98-00_(2)_123\tst.ps does not.

Is there any reason why it wouldn't?
Thanks,
F

surprised the first one works. It's not the brackets I see as the
problem but that \t sequence which is interpreted by C++ as a tab
character.

Use / instead of \. You can use \\ but / is recommended.
 
F

fatima.issawi

Hi Earl,

Tried to change it. The slashes are not the problem. Any other ideas?

Thanks for the quick reply.
 
B

Bill Medland

Hello,

Are brakets () allowed in a file path?

On Windows it would appear so.
eg.

Passing:

Y:\trak\pdf\98-00_2_123\tst.ps works but

Y:\trak\pdf\98-00_(2)_123\tst.ps does not.

Is there any reason why it wouldn't?
Thanks,
F
Because the first exists and the second doesn't? They are two different
file names.
 
S

Salt_Peter

Hi Earl,

Tried to change it. The slashes are not the problem. Any other ideas?

In what are you storing the filename?
what are you doing with the filename?
what do you mean by "it doesn't work"?
 
J

Jim Langston

Hello,

Are brakets () allowed in a file path?

eg.

Passing:

Y:\trak\pdf\98-00_2_123\tst.ps works but

Y:\trak\pdf\98-00_(2)_123\tst.ps does not.

Is there any reason why it wouldn't?
Thanks,
F

It shoudl work. std::cout << whatever you have
"Y:\trak\pdf\98-00_(2)_123\tst.ps" stored in and make sure that's what it
actually is.
 
F

fatima.issawi

I found the problem: One of the programs I use called a vb shell. The
brakets were causing the problem there.

Thanks for all your help.
 

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
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top