I’m trying to get the following find command to work via NSTask:
find /Users/user/projects ! -path '*.git*' -ctime -1
However I am having trouble to get the ignore path part to work. In terminal it works fine. I get the modified files of the last 24 hrs excluding the .git directories.
When using NSTask, the .git directories are not ignored, resulting in way too many positives……
I am using the following args:
NSArray *args = @[@"/Users/user/projects", @"!", @"-path", @"'*.git*'", @"-ctime", @"-1"];
Does anybody know what I am doing wrong?
I think you have to replace the argument
by
otherwise find will ignore only files that are named
'*.git*'(verbatim). Note that the shell removes the single quotes when you execute the command in the Terminal.