Warning: FileSystem.CopyFile operation failed. Could not find a part of the path

Warning: FileSystem.CopyFile operation failed. Could not find a part of the path

No idea what is wrong as file paths looking identical, is that because any symbol of the path needs to be changed? for example " \ "?

As, I can’t see the full script… the basic questions are:
Are you using String for the Path?
Also, did check if you have permission to write in that folder or not?

Yes, String for destination path and yes right to write on the folder. Maybe when file path is string, it needs to replace " \ " for " // " or something similar? I remember to see something like that before in other scripts but not sure here

For strings in code block format two \'s are used for \ as on its own it is an escape character. Use a watch node to check the file path and compare it to the windows file path as well, it only takes one mistake for it not to match.

1 Like

Hi @ruben.romero
Maybe try

Cheers

I tried, same warning message, nothing changes, I tried also " // ", the bars heading the right way :smiley:

I tried to change the destiny path to the Computer Desktop but I get different warning, it is a directory, not a file, so I added the file name with extension after the desktop directory path but same warning than beggining. No idea what more to do or missing something.
image

I also replaces spaces by %20 as this post indicated. File.Copy node issues - #8 by PauLtus

Can you show the full filepaths? Even if you have to use an example file and two desktop locations it would be helpful to see the whole picture here.

1 Like

image
it does say it all

2 Likes

You shouldn’t need to replace “ “ with “%20” either.

Make sure you have extensions and that any hard coded string inputs are either in a string node or that the escape character is escaped as Gavin mentioned.

Also make sure these are real files not some black magic cloud trickery like you may have with Desktop Connector, OneDrive, DropBox, Box, Google Drive, etc… If the files or path doesn’t actually exist yet then you can get the first error message even if your \ need not be escaped.

1 Like

then that node only overwrites existing files in existing folder, then why to copy?

That is unique to those cloud tools I mentioned. Folders are often not created in those locations using standard windows commands as cloud services are that different than local disc services.

Are Autodesk Desktop Connector local drive folders an exception?

Nope. I’ll preface this with “ This is current as of DTX 15.1, so it may be different now or at some point in the future.”

Until the folder is synchronized between the cloud and disc, they don’t actually exist on the disc, or they don’t exist on the cloud. Further, programmatically writing in bulk via DTC using anything but the UI is unsupported at this time, so you should look into other tools (said another way: use Forge for this as that tool is built to do this). I have seen some VERY skilled people do amazing things which look like they work on Tuesday, but then you add five more users and make it an active project and suddenly things stop working entirely and you need one of my colleagues to put your stuff back in order.

My first rule of working off the cloud is that nothing you previously did with files will work on the next iteration, and you will have to add a BUNCH more checks into the system unless you move to the prescribed method of doing what you are after.

And the prescribed method of bulk transfer of files on BIM360 / ACC is Forge.

2 Likes