Perforce P4Api.net add file get this Can't add filenames with wildcards [@#%*] in them

307 views Asked by At
string f = "C:\[email protected]"
cmd = new P4Command(p4, "add", true, "-c", changelist.Id.ToString(), f);

When my file name contains "@" this character , it log error exception :

add file get this Can't add filenames with wildcards [@#%*] in them

How do I fix that , I using p4api.net.

1

There are 1 answers

1
Samwise On BEST ANSWER

From the command line you can pass the -f flag to force files with wildcards to be added:

C:\Perforce\test\chars>p4 add -n foo@bar
The file named 'foo@bar' contains wildcards [@#%*].
Can't add filenames with wildcards [@#%*] in them.
Use -f option to force add.

C:\Perforce\test\chars>p4 add -n -f foo@bar
//stream/main/chars/foo%40bar#1 - opened for add

It looks like P4Command lets you just pass a server command (and its arguments) to the constructor, so you should be able to do:

new P4Command(p4, "add", true, "-c", changelist.Id.ToString(), "-f", f);