"Cannot move file" and "Cannot create directory"

Get help for specific problems
Posts: 24
Joined: 3 Nov 2016

mikexx

I thought there was no limitation of path lengths with FFS?

I'm getting errors where I'm synchronising files with FFS working on a remote PC using Remote Desktop.

Cannot move file
"\\tsclient\D\W..............................e~50d1.ffs_tmp" to "yyyyyyyyyyyyyyyyyyy"
ERROR_NO_SYSTEM_RESOURCES: Insufficient system resources exist to complete the requested service. [MoveFileEx]
where the path and file name are 279 characters long. There are also brackets ( ) in the path but not sure if that's significant.

And
Cannot create directory "\\tsclient\D\W................................"
ERROR_GEN_FAILURE: A device attached to the system is not functioning. [CreateDirectory]
Again a long path name of 265 characters.

Happy to provide logs on a private basis.
User avatar
Posts: 3600
Joined: 11 Jun 2019

xCSxXenon

Does it work if you shorten the paths? That way we can verify if it is a path issue or not.
Posts: 24
Joined: 3 Nov 2016

mikexx

It is unique to long path lengths. This does not affect paths less than ~256. One with a length of 235 charcters is ok, one with 260 is not.
User avatar
Posts: 3600
Joined: 11 Jun 2019

xCSxXenon

What are you transferring from and to? Does the path limit have to be disabled on both?
Posts: 24
Joined: 3 Nov 2016

mikexx

Path limits have been removed and both PCs have been rebooted. File synchronisation is taken place between a client PC and its host in a Remote desktop session.
Posts: 943
Joined: 8 May 2006

therube

There are limitations everywhere - in particular on Windows.
And on Windows "lfn" is more of a hodge-podge rather then a given.
And magic numbers like "32,767" are often a misnomer. You think, "wow, 32K, that's great", but that's not the whole story. Every part of the path+name that makes up that 32K is limited to (a paltry) 255 chars.

Even with "lfn" enabled (in Win10), many MS utilities still don't take advantage of lfn.

And then third party programs, depending on what functions they use...
Like the messages above reference MoveFileEx & CreateDirectory where MoveFileExW & CreateDirectoryW might offer a work-around in your situation.

Third party example:
I can drag a lfn from within Everything into mpv.net.
(Without this ability, I wouldn't even be able to open the file, period.)
Everything, knowing that it is a lfn, sends the sfn, which mpv.net then gladly accepts.
mpv.net has a function that displays media info of a file.
That works great - with sfn, but with a lfn (I take it that) it is the lfn that is being sent to MediaInfo, & that fails. If it were sent the sfn, that would work. Or, in this case, on a Win10 system with lfn enabled (long path), that too would work.

Naming Files, Paths, and Namespaces
Maximum Path Length Limitation
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

FFS uses the form "\\?\UNC\tsclient\D\W................................" when the path is 248 characters or more, as documented on https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createdirectoryw
(You could verify that this is in fact happening via Process Monitor.)
If such a long path then is still an issue, the problem lies with the target device.
Posts: 24
Joined: 3 Nov 2016

mikexx

I have run FreeFileSync and Process Monitor. On the remote PC I see a truncated 260 character length path.

There is no \\?\ at the beginning of the path. This is with 11.3

HTH
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

I have run FreeFileSync and Process Monitor. On the remote PC I see a truncated 260 character length path.

There is no \\?\ at the beginning of the path. This is with 11.3

HTH mikexx, 07 Oct 2021, 15:25
Can you share the Process Monitor log?