Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include symlink destination in path info. #169

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

rcfox
Copy link
Contributor

@rcfox rcfox commented Nov 26, 2023

What do these changes do?

The existing parse_list_line_unix function goes to all the work of parsing symlink lines, but omits the actual destination of the symlink. This tiny change adds the parsed destination to the path's info dictionary.

Are there changes in behavior for the user?

One extra key is included in the info dict when issuing a LIST command to a unix server.

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

The existing `parse_list_line_unix` function goes to all the work of parsing symlink lines, but omits the actual destination of the symlink. This tiny change adds parsed destination to the path's info dictionary.
@pohmelie
Copy link
Collaborator

FTP protocol have nothing about link type. It is just internal part of current implementation. If you need all this information, you should use parse_list_line_custom and use your own parse code or copy-paste existing one with your fixes.

@nE0sIghT
Copy link

nE0sIghT commented Jan 7, 2024

+1 for this change.
As of now the size reported by the stat is a link file size, but not a link target size.

With current implementation there is no way to know if the size is valid.

nE0sIghT added a commit to nE0sIghT/apt-mirror2 that referenced this pull request Jan 7, 2024
There is no way to know if the file is link with current aioftp's LIST
parsing implementation, however we can use custom parser to insert link
info and try to stat link destination.

See-Also: aio-libs/aioftp#169
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.89%. Comparing base (8453684) to head (49afcd2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #169   +/-   ##
=======================================
  Coverage   98.89%   98.89%           
=======================================
  Files           6        6           
  Lines        1895     1896    +1     
=======================================
+ Hits         1874     1875    +1     
  Misses         21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pohmelie pohmelie merged commit 0dda701 into aio-libs:master Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants