Forward slash is getting converted to backslash in folder name

Advertisement

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,565
Location:
Prague, Czechia

Re: Forward slash is getting converted to backslash in folder name

Where exactly do you type the path name? Please post some screenshots documenting the problem.

Reply with quote

FeRDNYC
Joined:
Posts:
7
Location:
Bronx, NY, USA

Possible conversion, but in other direction

The only area of WinSCP that I can find where slashes may be replaced/converted is in a mask definition, and it's actually a transformation in the opposite direction.

Normally if you type a path into e.g. the Edit Filter interface's Exclude (or Include) directories list, WinSCP will automatically end it with a slash to indicate directory filtering. But if you enter a path that contains a backslash, WinSCP will switch to using backslashes as the directory separator, and will end the path with a backslash instead.

That could be an issue if you were trying to backslash-escape some character, thinking that the filter configurations were regular expressions when they're not. Backslashes don't escape characters in WinSCP masks, so if you use them there you're adding a directory separator that may not be intended.

(For example, someone wanting to exclude a directory with the terrible name "My*Files" might try to use My\*Files as the filter pattern, thinking they can escape the *. That will actually filter My/*Files/ (or My\*Files\, since slashes are interchangeable in WinSCP). The correct pattern, as the documentation notes, is My[*]Files. Similarly, there's no reason to escape . characters in WinSCP patterns, since they have no special meaning. So, a pattern like File*\.txt would again insert an accidental directory separator, and should just be File*.txt.)

That's a wild guess, since it's the only instance of slash replacement I can think of offhand. I agree that screenshots or a better set of steps to reproduce would be very helpful.

Reply with quote

Advertisement

You can post new topics in this forum