Review internal tree traversal of symlinks

Open
#164 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
clojure

Research direction

Start with the internal file-seq and proposed path-seq traversal, then inspect their use by modified-since and zip. Resolve whether symbolic links should be ignored or controlled by a :follow-links option, including circular trees. Done means the behavior is agreed and affected functions have coverage for the chosen policy.

Written by the indexing model from the issue text.

Description

While @borkdude was having a peek at #163 he noted that the internal file-seq (which PR replaces with internal path-seq) does not take symlinks into account.

This internal fn is used by modified-since and zip.

Option 0: Do nothing

Affected fns will navigate symbolic links in dir/file trees, potentially getting into circular behaviour.

Options 1: Never follow symbolic links

Never follow symbolic links for affected fns.
I'm guessing that this is typically what users might want?

Option 2: Optionally follow symbolic links

Like other fs fns, add a :follow-links option, default false.

Proposal

Option 2 seems to be the most flexible. Is there any issue with option 2?

Next Steps

Happy to do up a PR after path is chosen.

Dominant language
Clojure
Stars
221
Forks
52
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from babashka/fs

All issues in babashka/fs

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.