Python Forum
Path.relative_to() and symlinks
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path.relative_to() and symlinks
#1
when a .relative_to() method is invoked for a Path() of a symlink, it follows the symlink and works on the object that symlink points to. but i want to detect if the symlink itself is relative to the object passed in the arg. my use case: a script (named "junk") to junk [verb] files being invoked by another script in which it might pass objects that are (already) in the "~/junk" directory. in the case of a symlink already there, it fails to detect that because that symlink points to somewhere outside the "~/junk" directory. how can i detect this based on where the symlink is?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,149 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  PurePath.relative_to() fails in 3.6 Skaperen 5 3,478 Oct-18-2019, 06:28 AM
Last Post: DeaD_EyE
  .pth file does not show up in sys.path when configuring path. arjunsingh2908 2 5,670 Jul-03-2018, 11:16 AM
Last Post: arjunsingh2908

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020