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

SFTP File Create Time #487

Open
Wildcatii opened this issue Nov 12, 2018 · 1 comment
Open

SFTP File Create Time #487

Wildcatii opened this issue Nov 12, 2018 · 1 comment

Comments

@Wildcatii
Copy link

How can i get create time of the sftp item?
I can not find create time property in SftpFile class,just find LastWriteTime and LastAccessedTime.

@jimbobmcgee
Copy link

From what I can see in the code (e.g. at https://github.com/sshnet/SSH.NET/blob/develop/src/Renci.SshNet/Sftp/SftpFileAttributes.cs#L516), support for parsing SSH_FILEXFER_ATTR_CREATETIME (0x10) (defined in https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-7.1) is not implemented.

This may be because many filesystems do not actually have the concept of create time -- Windows/NTFS certainly does but, since POSIX does not mandate it, many UNIX-likes do not include this detail.

SSH_FILEXFER_ATTR_CREATETIME was introduced to the draft spec circa revision 3. Whether this is a deliberate design decision by the development team not to include non-POSIX attributes, or a desire to maintain standards/compatibility with the older drafts, I couldn't tell you. From the looks of https://github.com/sshnet/SSH.NET/blob/develop/src/Renci.SshNet/Sftp/SftpFileAttributes.cs, it might not be too difficult for you to patch rudimentary support in.

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

No branches or pull requests

2 participants