Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Cannot get real path for '.'. The file path does not exist or is invalid. Error code: 10

@chaminda: What did you map actually? The home folder of the user? Can you work with that folder with any other SFTP client?
chaminda

Cannot get real path for '.'. The file path does not exist or is invalid. Error code: 10

Cannot get real path for '.'. The file path does not exist or is invalid. Error code: 10

at the SFTP server side I managed to map a folder in network drive successfully. However, when I use WinSCP to access via SFTP it gives me this error.
haglerca

Reply

You're welcome!
moonman

Resolved winscp cannot get real path for '.'

Thank you to the person above who helped remediate my issue.

My issue was that someone changed the default SFTP folder for the user to a SFTP folder that the user did not have access to or a SFTP folder which did not exist.

Tips:

  • Double check what the default folder is for the user
  • Check permissions on folder
haglerca

Bug resolved

The error was happening when trying to go to root directory because did not have permission to read the root directory on that server. Once permissions were updated, the issue resolved itself.
haglerca

Cannot get real path for '.'

The root directory is ...

Using WinSCP Version: 5.7.4
Windows 7 Enterprise
Transfer protocol SFTP
Using GUI(Commander interface) and .NET
.NET error message:
ex.Message: Error getting name of current remote directory
- e {WinSCP.SessionRemoteException: Error getting name of current remote directory. ---> WinSCP.SessionRemoteException: Cannot get real path for '.'.
The file path does not exist or is invalid.
Error code: 10
Error message from server (en): The file path does not exist or is invalid.

Steps to reproduce problem: GUI (Commander interface):

  • Open GUI
  • Click Login
  • GUI (Commander interface) error message:
    Error getting name of current remote directory
    Cannot get real path for '.'.
    The file path does not exist or is invalid
    Error Code: 10
    Error message from server(en): The file path does not exist or is invalid.


Steps to reproduce problem (.NET):

  • using C# Example code from documentation here (https://winscp.net/eng/docs/library#csharp) - I copied and pasted this C#.NET code example
  • When code hits the following line of code, error detailed above gets thrown -
    session.Open(sessionOptions)

    (which means the session wont open);

Without knowing too much, my suspicion is that WinSCP is looking at the current directory which is . (dot) and it is not able to resolve this path. Is there a way in .NET code to configure WinSCP to look at a specific directory and not the . (dot)? I can control it with the Commander interface by going to Advanced > Environment > Directories > Remote directory: (How do I do the equivalent in .NET code?) Or maybe a way for it to accept . (dot) ? I can't find any code that can be implemented prior to session.Open(sessionOptions) that would allow me to tell the session what directory it should be in.
Thanks in advance. Log file attached.