Welcome, Guest. Please login or register.

Author Topic: What's the problem with parenthesis containing filenames?  (Read 1827 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AmigaManceTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
What's the problem with parenthesis containing filenames?
« on: August 03, 2006, 05:39:29 PM »
It seems that AmigaDos is unable to handle filenames that contains parenthesis. It can not copy, rename, delete them and so on.
 For example, copy dh7:my_file(new).txt ram: fails until i use the WorkBench, open the window of dh7: and rename the file by removing the (). Then AmigaDos can handle the file properly. Why is this happening?
A1200 PPC user.
 

Offline mr_a500

  • Hero Member
  • *****
  • Join Date: May 2004
  • Posts: 865
    • Show only replies by mr_a500
Re: What's the problem with parenthesis containing filenames?
« Reply #1 on: August 03, 2006, 05:56:06 PM »
Hey, you're right. It happens with delete and rename too.

I never noticed this because I always use a filemanager (ABCdir) for copying and deleting and there is no problem with these filenames in the filemanager.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: What's the problem with parenthesis containing filenames?
« Reply #2 on: August 03, 2006, 05:59:16 PM »
I guess you are not familiar with amigados wildcard syntax?

The following are reserved for pattern matching:

( ) [ ] ~ | # ? % `

Here's what they do

? matches any single character. so a? matches all 2-letter words beginning with a.

# matches zero or more copies of whatever follows it, so b#a matches b, ba, baa, and so on.

() groups expressions together - useful in combination with | and ~

~ negates the meaning of whatever follows it. Hence ~(#?.info) matches everything which doesn't end in .info

| represents an either/or choice. e.g. foo.(txt|doc) will match both foo.txt and foo.doc

[] defines a letter range. e.g. [a-d].txt will match a.txt, b.txt, c.txt and d.txt,

% matches the null (empty) string. Never really found much use for this one :-)

` escapes the next character if it is any of the above wildcards. You'd need this for your brackets to suppress their wildcard meaning.

The most common combination wildcard is #? means any quantity of anything, i.e. everything!
int p; // A
 

Offline AmigaManceTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: What's the problem with parenthesis containing filenames?
« Reply #3 on: August 03, 2006, 06:05:27 PM »
Quote
I guess you are not familiar with amigados wildcard syntax?

 Wrong guess.. I just want to know why this happens.
A1200 PPC user.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: What's the problem with parenthesis containing filenames?
« Reply #4 on: August 03, 2006, 06:07:31 PM »
Quote

AmigaMance wrote:
Quote
I guess you are not familiar with amigados wildcard syntax?

 Wrong guess.


Then you should know (see earlier post) that brackets are used by the wildcard system and need to be escaped if you are using them in filenames, which of course you shouldn't because they are reserved for the wildcard system :-P
int p; // A
 

Offline Ilwrath

Re: What's the problem with parenthesis containing filenames?
« Reply #5 on: August 03, 2006, 06:11:35 PM »
Quote
Then you should know (see earlier post) that brackets are used by the wildcard system and need to be escaped if you are using them in filenames


Alternately, you could just put the path/filename in quotes, as well.  :-)

But, of course, for the sake of sanity...  DON'T USE THE RESERVED CHARACTERS!   :-D
 

Offline AmigaManceTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: What's the problem with parenthesis containing filenames?
« Reply #6 on: August 03, 2006, 06:11:51 PM »
@karlos
 Oh, i see now. Thanks, i wasn't that familiar with wildcards.
A1200 PPC user.
 

Offline AmigaManceTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: What's the problem with parenthesis containing filenames?
« Reply #7 on: August 03, 2006, 06:18:05 PM »
@Ilwrath

 I just tried to use quotes but it doesn't work. so, yeah, it's better not to use reserved characters. In fact i never use them. I got the filenames from the internet.
A1200 PPC user.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: What's the problem with parenthesis containing filenames?
« Reply #8 on: August 03, 2006, 06:25:18 PM »
If you think amigados wildcards are harsh, you'd love RegEx syntax :-D
int p; // A
 

Offline xeron

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 2533
    • Show only replies by xeron
    • http://www.petergordon.org.uk
Re: What's the problem with parenthesis containing filenames?
« Reply #9 on: August 03, 2006, 07:33:20 PM »
As karlos said, though, you can still manipulate the files using the apostrophe, IE:

rename file_'(with_brackets').txt file_without_brackets.txt
Playstation Network ID: xeron6
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show only replies by meega
Re: What's the problem with parenthesis containing filenames?
« Reply #10 on: August 03, 2006, 09:32:39 PM »
Maybe off-topic a little, but I like to pattern match on ~(*.*) in script files. It works a treat.
:)
 

Offline AmigaManceTopic starter

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 1278
    • Show only replies by AmigaMance
Re: What's the problem with parenthesis containing filenames?
« Reply #11 on: August 03, 2006, 09:49:05 PM »
Quote
As karlos said, though, you can still manipulate the files using the apostrophe, IE:

rename file_'(with_brackets').txt file_without_brackets.txt

 Oh, right. This works. :-)
A1200 PPC user.