TCC/LE 13.0 error with long file names and quotes

Sep 28, 2011
3
0
#1
We are trying to solve a couple of problem within a large file sytem (more than 30 milion files, more than 100,000 directories) using TCC (TCC LE 13.00.21 x64 Windows 7 [Version 6.1.7601]).

Using TCC we are running into two major problems that we cannot solve so far:

1. Errors on long file names (although the release notes state that the limitations have been removed in version 13)
- some variable functions like @filesize, @filetime and even a regular dir do not work on file names over 257 characters (including directory). The same commands do work correctly using CMD.EXE
Example (UNC path length 140 chars, file name length 120 chars):
for %i in ("{long UNC path}\*.*") echo %@attrib["%i"]
output is correct
for %i in ("{long UNC path}\*.*") echo %@attrib["%i"]
result is -1
for %i in ("{long UNC path}\*.*") *dir "%i"
TCC: (Sys) The system cannot find the file

2. File names including single quotes and back ticks ´,`,'
Since we are processing file names including blanks we have to quote file names. File names with single quotes result in "missing closing quote" messages. Setdos /x-7 would solve the problem but does not allow variable functions anymore. The only solution would be a more granular setdos disabling only single quotes and still allowing double quotes.

In the mean time we have reverted back to cmd.exe missing some functionality but being able to handle all these very "special" file names correctly.

Any ideas?
 
Sep 28, 2011
3
0
#2
just found a typo in the post:

Example (UNC path length 140 chars, file name length 120 chars):
for %i in ("{long UNC path}\*.*") echo %@attrib["%i"]
output is correct
for %i in ("{long UNC path}\*.*") echo %@filesize["%i"]
result is -1
 
Sep 28, 2011
3
0
#3
I have found a workaround for the back quote problem that has worked for my purposes by replacing the back quote with a question mark and using the wildcard in further commands:

for %i in (*.*) do gosub process
quit

:process
setdos /x-7
set filename=%@replace[`,?,%i]
setdos /x+7
... further processing using %filename%
return
 
Apr 1, 2013
1
0
#4
We are trying to solve a couple of problem within a large file sytem (more than 30 milion files, more than 100,000 directories) using TCC (TCC LE 13.00.21 x64 Windows 7 [Version 6.1.7601]).

Using TCC we are running into two major problems that we cannot solve so far:

1. Errors on long file names (although the release notes state that the limitations have been removed in version 13)
- some variable functions like @filesize, @filetime and even a regular dir do not work on file names over 257 characters (including directory). The same commands do work correctly using CMD.EXE
Example (UNC path length 140 chars, file name length 120 chars):
for %i in ("{long UNC path}\*.*") echo %@attrib["%i"]
output is correct
for %i in ("{long UNC path}\*.*") echo %@attrib["%i"]
result is -1
for %i in ("{long UNC path}\*.*") *dir "%i"
TCC: (Sys) The system cannot find the file

2. File names including single quotes and back ticks ´,`,'
Since we are processing file names including blanks we have to quote file names. File names with single quotes result in "missing closing quote" messages. Setdos /x-7 would solve the problem but does not allow variable functions anymore. The only solution would be a more granular setdos disabling only single quotes and still allowing double quotes.

In the mean time we have reverted back to cmd.exe missing some functionality but being able to handle all these very "special" file names correctly.

Any ideas?

I have also encountered long file name errors like:

"Error cannot delete file: cannot read form the source file or disk."
"Cannot delete file or folder. The file name you specified is not valid pr too long. Specify a different file name."

probably it is because of the Windows Explorer/FAR would fail to copy/rename/delete any pathname longer than 256 characters (Path Too Long Error).

I have read some forums on how to solve this problem and some recommend me to use Long Path Tool. I tried to use this tool and it really works. I guess this would help.