Author Topic: insert_file_list() is including broken symlinks in beta3, but not in 26.0.3  (Read 93 times)

rowbearto

  • Senior Community Member
  • Posts: 2206
  • Hero Points: 132
In v27 beta3 it seems that insert_file_list() is including broken symlinks in its listing. By broken symlink I mean that the symlink exists but it is pointing to a target file that no longer exists.

In 26.0.3 the insert_file_list() does not include broken symlinks in its listing.

I prefer the old behavior where insert_file_list() doesn't include broken symlinks.

Is this a bug in insert_file_list() in beta3?

I'm on Linux x64.

Thanks!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6396
  • Hero Points: 497
Re: insert_file_list() is including broken symlinks in beta3, but not in 26.0.3
« Reply #1 on: September 21, 2022, 11:53:42 pm »
I'm not able to reproduce this. Maybe it requires a specific set of switches. I tried a few. We haven't intentionally tried to change this. v27 is not including broken symlinks for me.

I just did this:
Code: [Select]
ln -s notfound link-notfound

I don't end up seeing "link-notfound" in my list.

rowbearto

  • Senior Community Member
  • Posts: 2206
  • Hero Points: 132
Re: insert_file_list() is including broken symlinks in beta3, but not in 26.0.3
« Reply #2 on: September 22, 2022, 01:43:08 am »
I'm invoking insert_file_list as below:

Code: [Select]
insert_file_list("-v +a +p <path> -wc <includes> -exclude <excludes>");
« Last Edit: September 25, 2022, 04:25:55 pm by rowbearto »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6396
  • Hero Points: 497
Re: insert_file_list() is including broken symlinks in beta3, but not in 26.0.3
« Reply #3 on: September 22, 2022, 02:12:29 am »
Reproduced. Seems to have something to do with the "-v" switch.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6396
  • Hero Points: 497
Re: insert_file_list() is including broken symlinks in beta3, but not in 26.0.3
« Reply #4 on: September 22, 2022, 04:38:20 pm »
Fixed for next build.

Code was optimized so it didn't call stat(). However, the problem with doing that is that symbolic links are supposed to be followed by default. Too bad, because it's 4 times faster when stat()'s are optimized out.

rowbearto

  • Senior Community Member
  • Posts: 2206
  • Hero Points: 132
Re: insert_file_list() is including broken symlinks in beta3, but not in 26.0.3
« Reply #5 on: September 22, 2022, 04:40:48 pm »
Thanks Clark!