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

How to symlink a file in the same directory #1336

Open
axelgenus opened this issue Feb 22, 2024 · 0 comments
Open

How to symlink a file in the same directory #1336

axelgenus opened this issue Feb 22, 2024 · 0 comments

Comments

@axelgenus
Copy link

I am using SSH.NET version 2024.0.0 (just upgraded).

I need to create a symlink to a file which is on the same folder with SftpClient.

The remote folder structure is pretty simple:

/
/exports
/exports/20240201.log
[...]
/exports/20240221.log
/exports/20240222.log
/exports/latest.log

latest.log needs point to the latest log (20240222.log in this case).

I tried using sftpClient.SymbolicLink("20240222.log", "latest.log") but GetCanonicalPath changes the path, resulting in a link to /20240222.log (which is wrong because it points to the root directory). I tried changing the working directory to "exports" but that results in a link to /exports/20240222.log (which is also wrong because the file is in the same folder).

Is this feasible?

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

1 participant