piranha / goreplace

command line tool for search and replace
ISC License
185 stars 14 forks source link

"Can't read file" error on a directory #21

Open alexwhitman opened 10 years ago

alexwhitman commented 10 years ago

I'm getting an odd error: Can't read file 'CMSADMIN/tinymce3/jscripts/tiny_mce': %!s(MISSING) - It's odd because the path printed is actually a directory, not a file, so I'm not sure why it's trying to be read in the first place in GetFileAndContent().

piranha commented 10 years ago

I wonder if this tiny_mce directory is a symlink?

alexwhitman commented 10 years ago

You're right, it is. I had forgotten that that had changed in the project recently.

piranha commented 10 years ago

Oh... I see, I need to make gr either skip them or go in, instead of printing an error. Thanks for the report, I'll try to get to that. :)

alexwhitman commented 10 years ago

grep follows the symlinks so might be best to do that. Just have to be careful about not getting into a loop.

piranha commented 10 years ago

Argh, filepath.Walk does not follow symlinks, and going around will require a bit of work. I'll try to fix this soon, just had no time.

piranha commented 10 years ago

Ok, I've got basics working (in symlink branch), but I need to get some path aliasing working, since right now it displays real path to file instead of path to symlink.