I have cut a file and can no longer paste or undo

Hi, I just used ctrl + x to cut a file in the asset browser and I can’t paste it. I get the following error message:

clojure.lang.ExceptionInfo: handler ‘:paste’ in context ‘:asset-browser’ failed at ‘:run’ with message ‘/Users/josh/Desktop/desktop/Defold Projects/visualinstrument - hold:trigger/trippy/trippykittyBG’
java.nio.file.NoSuchFileException: /Users/josh/Desktop/desktop/Defold Projects/visualinstrument - hold:trigger/trippy/trippykittyBG

I also can’t undo using ctrl+z, that option is blanked out in the edit menu.

The file I have deleted contains about a day’s work. If I quit defold without saving, will it reappear? What can I do to get the file back?

I have managed to recover the following files, including the scripts, from a previous build. However I still have lost all the images which took a long time to make.

Screenshot 2022-08-25 at 13.48.24

@88.josh: you could try and paste your file to the desktop or so, maybe this gets your file back.

Thanks for your reply. Paste is not available in the Apple file browser either.

Try clicking on the desktop and command - v, this could work.

Bummer , You can always try file recovery software , should be some free ones for mac. Can’t stress enough the importance of version control. Bitbucket , github etc.

2 Likes

I figured that was the stage I was at. Well, I have the script so it will only take a few hours to remake the images…

Sorry to hear you lost work. But I thought you said it was a single file? How could you also lose the images?

I mean it was a folder, not a file.

Would the files be in some temp folder somewhere, or do they just get copied into memory?

Cut files are placed in a temporary directory named asset-cut in your systems Temp folder. Unfortunately, this directory is deleted when you shut down the editor.

I’m really sorry this happened to you. I wonder if it might have something to do with the fact that there’s a colon (:) character in your project’s directory name? It seems to cause trouble on Windows & macOS (specifically Finder) at least. I would definitely consider renaming your project directory to avoid issues in the future.

3 Likes

Also, while I’m in here - I would strongly recommend using a version control system such as Git for your game project. Even if you don’t intend to host your project on GitHub or something similar, it lets you roll back the state or your project to the last time you made a commit.

We try very hard to not cause any data loss for our users when developing the editor, but it is not impossible that we could push an update that would strip some information out of your files by mistake. If your project is under version control, you have a safety-net of sorts, should that unfortunate event happen.

Of course, we would push a fix immediately if it happened, but you don’t want to be the guy that found and reported such an issue after it messed up your project without any way to restore it. :grimacing:

6 Likes

I was suspicious about this colon as well so tried to make a folder on my mac with one in it. The mac refused to create it. I then tried to add a new folder with a colon in the editor, Defold spotted this, too: my folder test:folder was simply renamed to testfolder.

Cut files are placed in a temporary directory named asset-cut in your systems Temp folder. Unfortunately, this directory is deleted when you shut down the editor

I will remember this next time. useful information.

I was suspicious about this colon as well so tried to make a folder on my mac with one in it. The mac refused to create it. I then tried to add a new folder with a colon in the editor, Defold spotted this, too: my folder test:folder was simply renamed to testfolder.

the file itself is called hold/trigger. I believe Defold renamed it to hold:trigger. I have now changed it to hold trigger (no punctuation).

I have not had this problem before even with this file name. I will see if the problem persists now I have changed the name.

6 Likes

Just reporting back on this: after experiencing the problem several times, I changed the file name removing the / and now the problem has disappeared. Thanks all for your help.

4 Likes

Interestingly, at least on my mac, when trying to create a file or folder in the editor with the delimiters “:” or “/,” Defold does not allow this and simply removes this char, so test:file becomes testfile.
But it does not remove this problematic character when the file is copied into the project folder. A file with a slash ends up as a file with a colon, so test/file becomes test:file.
Mac OS does not allow naming a file or folder with a colon in it, let alone paste it somewhere. I assume this is similar on Windows or Linux.
So, as Josh found out, files with a delimiter in the name can spell trouble.
Would be possible to automatically rename those problematic files copied into the folder structure as well or alert folks that their name contains an illegal character?

If something like this:

would be possible, maybe also could be possible to rename the animations in atlases, when you rename the pngs in the explorer? Whenever I change a png in the explorer, the atlases are always broken and I need to reimport them. I wish they could stay in the atlas, but the name of the animation just follows the name of the file, if it was changed. It could be difficult, but perhaps - possible?