This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS4 deletes contents of workspace

CCS4 appears to delete the contents of a workspace incorrectly, do the following:

(A) Create 2 workspaces W1 and W2. In W1 create 2 projects W1P1 and W1P2, in W2 create 2 projects W2P1 and W2P2.
(B) In W2 right click on project W2P2, copy, paste back but do not use default location use folder W1.
(C) Now W1 will have 2 projects: W1P1 and W1P2. W2 will have 3 projects: W2P1, W2P2, and Copy of W2P2.
(D) Go to Workspace 2 and delete the copy of W2P2 project, it will ask are you sure you want to delete project "Copy of W2P2?" select "Also delete contents under workspace W1" and execute the command.

You will find that it has deleted the complete contents of workspace 1 !!

Several things about this seem wrong to me:

(A)  Primarily - I did not ask it to delete the whole workspace, just the project.
(B) If you delete W2P1 it will delete only this W2 and not all projects in W2 - this is what I expect to happen so it does know to do this correctly.
(C) If I copy a project from W2 to W1 I really expected it to show up in W1.
..................

One other thing:: If you rename a project it does not rename newly created entities like the .out or .map files, they retain the old name. This does not seem logical to me either since one assumes these all have the project name as filename.

Roger Littlewood

 

 

  • Roger,

    In reading this I thought there was no way this could be the case but yeah I see the same behavior.  Deleting the copied project deletes the contents of the other workspace.  I was boggled by that until I talked to someone else about it.

    The reason this is happening is that when you are pasting the project and specifying that the folder for it is W1 it is saying that the project folder is "W1" not "W1\Copy of W2P2".  When you delete a project and confirm that you want to delete the files it deletes the project folder, which in this case is your W1 folder.  That is even what the prompt says, it says it is going to delete the contents of \W1

    For example if you expand "Copy of W2P2" in your project view you will see foldders for W1P1 and W1P2, i.e. they are actually part of the "Copy of W2P2" project as far as Eclipse is concerned, everything in the project directory is part of the project.

    When you do the paste if you specify "W1\Copy of W2P2" or whatever you want the project dir to me then you won't see this issue.

    John

  • John,

    Hum that behaviour is illogical I think. If you create something & then delete it, should it not delete only what you have just created? Maybe you did this copy thing months ago, now you are cleaning up your workspace and end up deleting some other workspace without realizing this - could be embarrassing!

    I thought project folders were inside workspace folders. I.e. there are workspaces and inside there are projects. Thus when we specify the folder for the copy is W1 what that means is stick it into workspace W1. How can it think the project folder is "W1" since if it were there would be no higher level workspace folder in this case. To actually make the project appear in W1 requires more fiddling about as well.

    It does make me doubt the logic of the whole thing. I’ll copy projects using Windows Explorer in future!

    Were you able to checkout the other issue where when you rename a project it retains the old name for all generated files?

    Regards   ---   Roger

  • Roger,

    By default project folders are inside workspace files when you create a new project but that is only the default, you can place a project in any location (it does not need to be under a workspace).  When creating a new project you can see the option to place it in a different location.  Similar idea to how you can have files inside your project and linked files outside your project.  You can also see this when you import projects, there is the option to "copy into workspace" if that is not checked it leaves the project in the original location but just references it.

    In your case when prompted for the new project location the workspace folder W1 was specified and not a folder under it.  If a folder under W1 was specified there would be no problem.  By specifying W1 you are saying this is my project folder.  It would be nice if Eclipse detected that this was a workspace folder and warned you similar to what it does if you try to create a project that has the same name as an existing one in the workspace or if you try to create a project in a location where there already is one.  Don't be me wrong, I think this is an easy mistake to make.

    I will need to check on the generated file names.  I am not sure that we have a way to add actions (like changing build options) when a rename takes place.  The only thing I can think of to workaround that is to use a macro for the first part of the filenames that is mapped to the project name.  I will check on that and if it is possible I will file a request.

    Regards,

    John