helm-ag icon indicating copy to clipboard operation
helm-ag copied to clipboard

Error: stat()ing: foo. Error opening directory foo: No such file or directory

Open AdelleBernal opened this issue 1 year ago • 3 comments

I need a function to search in filenames and retrieve those filenames containing the string I search for.

For some reason, this piece of code is not working for this purpose:

(defun helm-do-ag-projects ()
  "Grep string in Project directory" (interactive)
  (let ((rootdir (concat "~/my_projects/")))
    (let ((helm-ag-command-option (concat helm-ag-command-option "--all-text -g")))
      (helm-do-ag rootdir))))

Getting the error:

ERR: Error: stat()ing: foo. 
ERR: Error opening directory foo: No such file or directory

AdelleBernal avatar Mar 07 '23 12:03 AdelleBernal

I use helm-projectile for that – not sure if that'd do what you need?

toothbrush avatar Mar 09 '23 02:03 toothbrush

Thanks. Could I set up the project directory to any directory in my function?

AdelleBernal avatar Mar 09 '23 05:03 AdelleBernal

There is probably a way to set the project directory manually yes, although i believe by default projectile looks for a VCS root, so if you're using Git or another version control system i believe it'll do "the right thing" by default. My memory is hazy though because it's a long time ago i set it up for myself. On 9 Mar 2023, at 16:32, Adelle Bernal @.***> wrote: Thanks. Could I set up the project directory to any directory in my function?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

toothbrush avatar Mar 09 '23 06:03 toothbrush