We have a process that I’m trying to automate in which I have to check generated output files into perforce. I understand this is far from ideal, but it’s not something I can really get around. In order to ensure all generated files get into perforce I have to check an entire directory into perforce. According to perforce’s documentation in their knowledge base there’s a rather goofy looking but valid command you can run:
dir /s /b /a-d | p4 -x - add
Everything appears at first to run fine when you execute this, for each filename with an apostrophe (single quote?) I get a message saying
filename – missing, assuming text.
This despite the fact that my list of files to add was generated by dir. In otherwords, it should be impossible (barring perhaps another process interfering) for one of these files to be missing since it is the list of files in the dir.
If I try to submit the resulting changelist, submission fails when it cannot find the missing file(s). I’ve tried a couple of longshot things like redirecting the dir output into a file and then reading the arguments for add from that file, but it worked just the same.
Perhaps the craziest part of all of this is that I’ve discovered is that
p4 add Jim's_File.txt
works if I use tab complete, but fails if I type, paste, or pipe the name. I have no clue how to work around this behavior, but would really love some ideas.
Works for me:
Created a file named a’file.txt
Perhaps you should mention your Perforce version and operating system.
Generally speaking, it’s best to wrap each filename in quotes (
"a'file.txt") or, in Windows shell, use the^symbol to escape any characters that have special meaning.