[TC 11.01] FTP client - problems opening folders with space in front of the name

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

[TC 11.01] FTP client - problems opening folders with space in front of the name

Post by *alejandrodarz »

When you open a folder with a space in front of the folder name, it does not open.
Example:
Folder Name: "MyFiles/ Music"
Error: 550 Can't change directory to "MyFiles/Music".
The error is that it tries to open the folder named "Music" and that folder is not found, instead of opening " Music" with a space in front
If you remove the space if it open: "MyFiles/Music"

Moderator message from: petermad » 2023-09-20, 11:16 UTC

Changed the Topic title to be more descriptive
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.01] FTP client:

Post by *petermad »

How do you try to open "MyFiles/ Music"? Do you go into "MyFiles" and thereafter into " Music" - or do you type: cd MyFiles/ Music in the command line?

Anyway both ways work for me - so it might be a server problem.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client:

Post by *ghisler(Author) »

It's probably a problem with the FTP server, because the server sends a plain text listing, and you can't distinguish between a name with a space at the start and the normal column alignment. If possible, try using MLSD, it sends the names in a machine-readable way.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.01] FTP client:

Post by *petermad »

I can confirm that if I diable MLSD, the space in front of the folder name is not shown in the file panel, and I can NOT enter the folder.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client:

Post by *alejandrodarz »

petermad wrote: 2023-09-15, 01:32 UTC How do you try to open "MyFiles/ Music"? Do you go into "MyFiles" and thereafter into " Music" - or do you type: cd MyFiles/ Music in the command line?

Anyway both ways work for me - so it might be a server problem.
I go into "MyFiles" and thereafter into " Music"
if i type: cd MyFiles/ Music in the command line if it open

The server encodes in ASCII and does not support UTF-8, so it has no problems, it opens folders with spaces in front

MLSD is activated, if I deactivate it the space is not shown but you cannot access it either
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client:

Post by *alejandrodarz »

ghisler(Author) wrote: 2023-09-15, 17:29 UTC It's probably a problem with the FTP server, because the server sends a plain text listing, and you can't distinguish between a name with a space at the start and the normal column alignment. If possible, try using MLSD, it sends the names in a machine-readable way.
The server does send the correct name, but when the Total Commander receives "MyFiles/ Music" it does not interpret the space in front of Music, apparently due to the ASCII encoding

If sent via command line:
cwd Music
I get the same error but if I send:
cwd " Music"
there it does open
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC 11.01] FTP client:

Post by *petermad »

2alejandrodarz
alejandrodarz wrote:if i type: cd MyFiles/ Music in the command line if it open
This sentence doesn't make sense - do you get into the " MyFiles" folder when you type cd MyFiles/ Music in the command line?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client:

Post by *alejandrodarz »

petermad wrote: 2023-09-16, 03:09 UTC 2alejandrodarz
alejandrodarz wrote:if i type: cd MyFiles/ Music in the command line if it open
This sentence doesn't make sense - do you get into the " MyFiles" folder when you type cd MyFiles/ Music in the command line?
In the command line when I type: cd MyFiles/ Music, open in the " Music" folder
But if you try to enter the " Music" folder normally without the command line, it does not open.
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client:

Post by *alejandrodarz »

The error would be here:
NameFolder := " Music"
Total Commander sends:
CWD NameFolder
But you should send:
CWD '"' NameFolder '"'
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client:

Post by *ghisler(Author) »

If your server doesn't support MLSD, you can define a custom template with Alt+Shift+Enter during a connection. Start e.g. with the Unix sample template and adjust it until it works with your server. This allows to define a server type with fixed space widths, so spaces at the start of the name can be detected.
Author of Total Commander
https://www.ghisler.com
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client:

Post by *alejandrodarz »

ghisler(Author) wrote: 2023-09-17, 20:06 UTC If your server doesn't support MLSD, you can define a custom template with Alt+Shift+Enter during a connection. Start e.g. with the Unix sample template and adjust it until it works with your server. This allows to define a server type with fixed space widths, so spaces at the start of the name can be detected.
The server does support MLSD, but I also tried defining a custom template with Alt+Shift+Enter during a connection and it didn't work, I still have the same error. The problem is not when interpreting the space, the folder is shown with the space in front, it is when opening it that total commander sends the cwd + namefolder parameter, but it should send cwd '"' namefolder '"' to be able to open the folder with space in front.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client:

Post by *ghisler(Author) »

Please post the template you used.
Author of Total Commander
https://www.ghisler.com
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client:

Post by *alejandrodarz »

ghisler(Author) wrote: 2023-09-20, 10:54 UTC Please post the template you used.
I have tried anyway and the folder with space in front does not open,
-"pppppppppp !S* TTT DD UUUUU $n*"
-"pppppppppp !S* TTT DD UUUUU n*"
-"pppppppppp !S* TTT DD UUUUU -n*"
-"pppppppppp !S* TTT DD UUUUU!n*"
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.01] FTP client - problems opening folders with space in front of the name

Post by *ghisler(Author) »

The standard Unix template works for me:

Code: Select all

pppppppppp                     !S* TTT DDDDDDDD n*
Your first one with $n will ignore the leading spaces.
Author of Total Commander
https://www.ghisler.com
alejandrodarz
Junior Member
Junior Member
Posts: 9
Joined: 2023-09-15, 00:19 UTC

Re: [TC 11.01] FTP client - problems opening folders with space in front of the name

Post by *alejandrodarz »

ghisler(Author) wrote: 2023-09-23, 09:12 UTC The standard Unix template works for me:

Code: Select all

pppppppppp                     !S* TTT DDDDDDDD n*
Your first one with $n will ignore the leading spaces.
I will try it but I don't think that is the problem, I made a script with autohotkey that sends via command line: CWD ' " ' NameFolder ' " ' and it worked for me by putting " " to the CWD command
Post Reply