I am currently using C# and SSH.NET to upload files or folders to a Unix server. My problem is, that Unix is case-sensitive, whereas Windows is not, or at least not really. So I am having a problem if I copy a folder called "test", and another folder called "Test". The different case is no problem for Unix of course, but under Windows, when accessing the folder via Samba, I can see only the contents of one of them.
What I want to do is the following: If I upload a file or folder over sftp, but that file or folder already exists with another combination of upper- or lowercase, I want to rename the file to be copied to match the name already present.
Is there an easy and convenient way to do that? What I basically need is a case-insensitive check if a folder or parts of a folder already exist.