About Store Forum Documentation Contact
Donations:
392$/mo



Post Reply 
How to delete unused files.
Author Message
mizukami Offline
Member

Post: #1
How to delete unused files.
I want to know how to find unused files (located under "Game/", "Edit/"),
and delete it (with EE program).

I think, such file has no UIDs. If so, which method can get UID from each files? (or please tell me correct way in this situation)
and how to delete the file from filesystem?

Addiotion.
"unused" is the file that not shown at EE Editor.
(This post was last modified: 04-12-2016 04:16 AM by mizukami.)
04-12-2016 04:13 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: How to delete unused files.
Hi,

All files inside Game and Edit are needed for the project.

You can convert filename to UID using:
http://www.esenthel.com/?id=doc#Project_Files
UID id; DecodeFileName("-^s-i#kgump59pp5q^kq0i#e", id);

Please note that ELM_MESH, ELM_SKEL, ELM_PHYS are not displayed in the project list, but they are used by ELM_OBJ

If files are no longer used then they will be removed with next call to "Erase Removed Elements"
04-12-2016 01:21 PM
Find all posts by this user Quote this message in a reply
mizukami Offline
Member

Post: #3
RE: How to delete unused files.
(04-12-2016 01:21 PM)Esenthel Wrote:  All files inside Game and Edit are needed for the project.

Thanks always.

I guess, we had something missed with our operation in some way.
For example. Programmer (a),(b) working with their cooperation.

In case of generally.

1.(a) added a file "FOO". File "Data", and "Game/" updated (a)' local.
2.Doing sync files between (a) and (b). Then, (a) and (b)'s files are the same.

It's no problem. And missed case, next.

1.(a) added a file "FOO". File "Data", and "Game/" updated (a)' local.
2.(b) added a file "BAR", before syncing each files.

Now. If (a)'s files were overwritten by (b)'s (avoid conflict). File "FOO" will be lost. "FOO" located on the (a)'s local. But not in file "Data".
That's the reason why unused files shows in our project folder, i think.

(04-12-2016 01:21 PM)Esenthel Wrote:  You can convert filename to UID using:
http://www.esenthel.com/?id=doc#Project_Files
UID id; DecodeFileName("-^s-i#kgump59pp5q^kq0i#e", id);

Is "DecodeFileName();" same function as "FileNameID();"?
04-13-2016 03:43 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: How to delete unused files.
Hi,

Esenthel Editor and Esenthel Server should handle synchronization of files well, they shouldn't leave any unused files.

Unless you're trying to synchronize the files somehow manually (manually copy the files, please don't do this).

Project Elements and their files are completely removed only during the "Erase Removed Elements" phase.
If an element is removed, then its files from "Edit", "Game" and the element from Project "Data" are removed at the same time.
Please see here:
https://github.com/Esenthel/EsenthelEngi....cpp#L2059
which calls:
https://github.com/Esenthel/EsenthelEngi...t.cpp#L777

If you still experience the issue and can reproduce the problem, then please provide exact steps how to do that and I will check that.

for UID name function source please see here:
https://github.com/Esenthel/EsenthelEngi....cpp#L2374
https://github.com/Esenthel/EsenthelEngi....cpp#L1902
04-13-2016 04:33 AM
Find all posts by this user Quote this message in a reply
mizukami Offline
Member

Post: #5
RE: How to delete unused files.
(04-13-2016 04:33 AM)Esenthel Wrote:  Esenthel Editor and Esenthel Server should handle synchronization of files well, they shouldn't leave any unused files.
Unless you're trying to synchronize the files somehow manually (manually copy the files, please don't do this).

To make matters worse, our project using svn (before i joined in). sorry...
I think, it will change near future. however we must solve now situation (remove useless files or project clean-up).
What should i do?
04-13-2016 06:47 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: How to delete unused files.
Hi,

Quote:To make matters worse, our project using svn (before i joined in). sorry...
This is definitely the problem, please only use Esenthel Server for project synchronization.

"Data" file contains crucial information about your project (all elements used and some of their metadata). Using SVN you just replace the file from one computer, without doing any synchronization, which will cause many problems for you, including:
-project elements going missing
-project elements having outdated data
-many others

You can iterate all files in Game and Edit folders, with FileFind

Code:
Edit.EditorInterface EI;
EI.connect(..);
if(!EI.getElms(elms))Exit("can't get elms");

for(FileFind ff(game_folder_path); ff(); )
{
   UID id;
   if(DecodeFileName(ff.name, id)) // if this is ID based element
      if(!Edit.FindElm(elms, id)) // if was not found in the project
         FDel(ff.pathName()); // remove the file or folder
}

I wrote this quickly without testing, but should work ok, you can execute this for both "game" and "edit" folders.

Please try it first on a test project.



Alternative solution without writing any code is to:
-create a new empty project "Copy"
-open your existing project
-select all elements
-right click on them and select "copy\to another project"
-select "Copy" project as the destination and press OK
-only used files will be copied and the new project will not have any useless files.
04-13-2016 08:16 AM
Find all posts by this user Quote this message in a reply
mizukami Offline
Member

Post: #7
RE: How to delete unused files.
Thanks for many helps.

I confirmed that Esenthel Server works fine.
If i want to sync code (ELM_CODE), choose "Synchronize Codes" manually?
04-13-2016 10:54 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: How to delete unused files.
Hi,

I recommend synchronizing using external 3rd party tools:
http://www.esenthel.com/?id=doc#Synchronizing_Codes
The first method - available from "Build/Export/Code Synchronization"
04-13-2016 12:14 PM
Find all posts by this user Quote this message in a reply
Post Reply