CD into double backslash separated path makes TC consider files write protected even if they are not
Moderators: Hacker, petermad, Stefan2, white
CD into double backslash separated path makes TC consider files write protected even if they are not
(reproducable in TC 9.51)
Sometimes I quickly switch into directories by copying paths from JSON files and issuing "cd <path>" in the TC command line. Typically, these paths are double backslashed for escaping, e.g. "C:\\logs\\"
This works, but puts TC in a weird state, where the files inside are shown and supports most operations (e.g. copy, view), but specifically delete does not work - TC will claim the files are write protected and fail to delete them.
Steps to reproduce:
- Create a path C:\repro\
- Create a file C:\repro\repro.txt
- In TC command line issue the command "cd C:\\repro\\"
- Attempt to delete the file repro.txt.
- TC will fail to delete it, claiming the file is write protected
This is of course a very minor issue which is easily worked around.
Sometimes I quickly switch into directories by copying paths from JSON files and issuing "cd <path>" in the TC command line. Typically, these paths are double backslashed for escaping, e.g. "C:\\logs\\"
This works, but puts TC in a weird state, where the files inside are shown and supports most operations (e.g. copy, view), but specifically delete does not work - TC will claim the files are write protected and fail to delete them.
Steps to reproduce:
- Create a path C:\repro\
- Create a file C:\repro\repro.txt
- In TC command line issue the command "cd C:\\repro\\"
- Attempt to delete the file repro.txt.
- TC will fail to delete it, claiming the file is write protected
This is of course a very minor issue which is easily worked around.
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
For me this pathname is an illegal syntax and should simply be rejected by TC
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
2michaelkc
I cannot reproduce this - I can delete the file without problems. testet under Windows 7 and 10 with TC 9.51 x64- Create a file C:\repro\repro.txt
- In TC command line issue the command "cd C:\\repro\\"
- Attempt to delete the file repro.txt.
- TC will fail to delete it, claiming the file is write protected
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
The APIs of the OS accept such paths, and TC should not spend effort to reject path constructs that are accepted by the OS itself.Horst.Epp wrote: 2020-07-03, 12:42 UTC For me this pathname is an illegal syntax and should simply be rejected by TC
It would be a different story if TC would be required to normalize such paths prior to handing them over to the respective OS functions, but this is not the case here.
UPDATE: I changed my opinion with regard to path normalization. See my next post below...
Last edited by gdpr deleted 6 on 2020-07-04, 14:02 UTC, edited 1 time in total.
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
2Horst.Epp
2elgonzo
Can any of you two actually confirm michaelkc's steps to reproduce:
2elgonzo
Can any of you two actually confirm michaelkc's steps to reproduce:
Because I can NOT, as previously reported.- Create a path C:\repro\
- Create a file C:\repro\repro.txt
- In TC command line issue the command "cd C:\\repro\\"
- Attempt to delete the file repro.txt.
- TC will fail to delete it, claiming the file is write protected
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
No. Like you, i cannot reproduce. Not with the 64-bit nor the 32-bit version of TC 9.1 (running on Win 7 Pro x64)petermad wrote: 2020-07-04, 12:59 UTC Can any of you two actually confirm michaelkc's steps to reproduce:
However, i noticed TC stumbling over the doubled backslashes when trying to navigate to the parent directory (either by 'entering' the ".." item in the file list, or by Ctrl+PgUp, or by doing "cd .." in TC's command line). First, note that TC is showing the double blackslashes in the path above the file list. When trying to navigate to the parent directory, TC seems to attempt doing it by locating the 2nd-last backslash in the path string and taking everything left of it as the parent directory path. Which, when double backslashes are involved like in this case, does not really work at the first try. Basically
1. Start path as shown above the file list: X:\\Dir1\\*.*
2. Attempting to move a directory up will fail, however now the path above the file list will show: X:\\Dir1\*.* (note how there is now only a single backslash before "*.*")
3. Now again attempting to move a directory up will succeed.
UPDATE: Having observed this experience, i change my opinion expressed in my last post. In my opinion, TC should normalize paths provided by the user (or from some plug-in or other 'external' source) as TC's internal path string handling and manipulation relies on clean and sane path strings (as demonstrated here)
Last edited by gdpr deleted 6 on 2020-07-04, 14:07 UTC, edited 4 times in total.
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
No, I can't confirm his steps in my Environment (see signature).petermad wrote: 2020-07-04, 12:59 UTC 2Horst.Epp
2elgonzo
Can any of you two actually confirm michaelkc's steps to reproduce:Because I can NOT, as previously reported.- Create a path C:\repro\
- Create a file C:\repro\repro.txt
- In TC command line issue the command "cd C:\\repro\\"
- Attempt to delete the file repro.txt.
- TC will fail to delete it, claiming the file is write protected
I can delete the file in this path without problems.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
Reproduced! TC 9.51 x32, Windows 10 v. 2004 x64. I can't delete using DEL (or F8), but: 1) I CAN delete it, if I choose "as admin" (!) and 2) I CAN delete it using Shift+DEL.
Image: http://ipic.su/img/img7/fs/1759.1594032510.jpg
Steps to reproduce:
1. Create a folder (e. g. M:\downloads\temp) on your hard drive.
2. Press Shift+F4 and create an empty file (1.txt).
3. Return to the root of that drive and type in the command line: cd m:\\downloads\\temp. Both times with two backslashes. The path in the panel must contain two backslashes.
4. Select the file and press DEL. If TC asks for confirmation, confirm (maybe, twice). Then you'll see the error message.
5. Select "As admin" in this message box and try to delete the file.
Image: http://ipic.su/img/img7/fs/1759.1594032510.jpg
Steps to reproduce:
1. Create a folder (e. g. M:\downloads\temp) on your hard drive.
2. Press Shift+F4 and create an empty file (1.txt).
3. Return to the root of that drive and type in the command line: cd m:\\downloads\\temp. Both times with two backslashes. The path in the panel must contain two backslashes.
4. Select the file and press DEL. If TC asks for confirmation, confirm (maybe, twice). Then you'll see the error message.
5. Select "As admin" in this message box and try to delete the file.
We are not so S.M.A.R.T. as we imagine...
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
II can now confirm it when I try to move the file to Recycle Bin. I have the Recycle Bin disabled system-wise for most of my partitions, and I have changed TC's configuration to delete directly for Del / F8, so that is why I couldn't reproduce it in the first place.
But if I try to delete from \\repro\\ on a drive with enabled Recycle Bin using Shift+Del (deleting to Recycle Bin in my TC), then I can confirm that TC cannot delete the file unless I choose to do it as Administrator.
But if I try to delete from \\repro\\ on a drive with enabled Recycle Bin using Shift+Del (deleting to Recycle Bin in my TC), then I can confirm that TC cannot delete the file unless I choose to do it as Administrator.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: CD into double backslash separated path makes TC consider files write protected even if they are not
Using delete to recycle bin, i can now reproduce as well.