Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-235

Make ssh_sftp: list_dir return more information

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Help Wanted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ssh
    • Labels:

      Description

      ssh_sftp:list_dir returns the remote listing at a given path. The listing is a list of names of type string(). Apart from listing what's in a remote directory, this function seems to have a very limited use.

      It would be nice if it could return some more information about each item, e.g. whether its a file or a directory, its size, ctime, atime etc. There is a readdir function which can be used for this purpose but list_dir seems to be doing all of the accumulator loop stuff already. Another option is to call read_file_info on each item.

      This sort of functionality would be handy if provided by the stdlib.

      May be we can get another function list_dir_details or something similar that gives us more information about the listing? May be Name, Info tuples? I would think ssh_xfer_attr record would need to be exposed as well and put in an include directory may be.

      I can work on a PR if it seems something like this would be useful.

      Thanks!

      Edit: Couple of format edits.

        Attachments

          Activity

            People

            Assignee:
            otp_team_ps Team PS
            Reporter:
            verma verma
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: