v4.0.0 Missing files from project after closing project

Beta Testing discussion on mikroPascal PRO for PIC32.
Post Reply
Author
Message
VCC
Posts: 463
Joined: 08 Jun 2009 18:31
Location: Romania

v4.0.0 Missing files from project after closing project

#1 Post by VCC » 19 Feb 2019 07:30

Hi,

similar to this viewtopic.php?f=173&t=74223 bug report.
If the project contains source files from two different disk partitions (e.g. D and E), and the project is saved on one of them, then the files from the other partition may silently be removed from project after closing the project.
The bug shows up after closing and reopening the project.
For example, if the project is saved in D:\mP32_400_BugReport\Bug2\ and it contains a file like E:\mP32_400_BugReport\Bug2_Files\Bug2.mpas, then Bug2.mpas might be automatically removed from project.

Steps to reproduce (some steps are similar to this viewtopic.php?f=173&t=74223 bug report):
1. Make sure you have the D:\mP32_400_BugReport\Bug2 folder structure on your disk.
2. Make sure no project is loaded, then go to menu -> Project -> New Project.
3. Select Standard Project, click Next.
4. Set project name to (without quotes) "Bug2Rep", set project folder to "D:\mP32_400_BugReport\Bug2\", set device name (e.g. P32MX270F256D). Click Next, Next, Finish.
5. If the Edit project window opens, close it for now.
6. Save the Bug2Rep.mpas file now. Also, save the project.
7. Open "D:\mP32_400_BugReport\Bug2\Bug2Rep.mpp32" with Notepad++ or other text editor, which can detect file changes on disk.
8. At this point, the [FILES] section from Bug2Rep.mpp32 says that there is one file. So far so good. Go back to the IDE, open Project Manager and expand the Sources folder. Bug2Rep.mpas should be there.
9. Make sure you have a valid mpas file in "E:\mP32_400_BugReport\Bug2_Files" folder, either saved previously or created just now, but with a different text editor. (let's call it e.g. Bug2.mpas)
10. Right-click the Sources folder from the Project Manager, and select "Add Existing File...". Browse to "E:\mP32_400_BugReport\Bug2_Files\Bug2.mpas" file. The new file appears in Project Manager.
11. From Project Manager, expand all nodes up to Bug2.mpas then save the project. Go to Notepad++ (minimize and restore it to detect the file change on disk) and look at the [FILES] section. It contains the two source files of the project, but the new one has a ".\" in front of it.
[FILES]
File0=Bug2Rep.mpas
File1=.\E:\mP32_400_BugReport\Bug2_Files\Bug2.mpas

13. Close the project from menu -> Project -> Close Project
14. Open the project from menu -> Project -> Recent Projects -> D:\mP32_400_BugReport\Bug2\Bug2Rep.mpp32
15. From Project Manager, all nodes up to Bug2.mpas should already be expanded. Collapse and expand the Sources folder to trigger a "modified" state of the project, then save the project.
16. Go to Notepad++ (minimize and restore it to detect the file change on disk) and look at the [FILES] section. The path to Bug2.mpas is missing.
It should be File1=.\E:\mP32_400_BugReport\Bug2_Files\Bug2.mpas, but the section shows:
[FILES]
File0=Bug2Rep.mpas
Count=2

So, it looks like the IDE takes these ".\" paths as invalid and removes them from project.
17. Notice that Bug2.mpas is still displayed in Project Manager. Repeat steps 13 and 14 to reopen the project.
18. After reopening the project, the file is not present in Project Manager anymore.

Going further..
19. Close the project again. (step 13)
20. From Notepad++, the File1=.\E:\mP32_400_BugReport\Bug2_Files\Bug2.mpas entry should still be present under [OPENED_FILES] section. Copy this entry under [FILES] section.
21. Go back to the IDE and open the reopen project (step 14).
22. Go to Project Manager (Bug2.mpas is displayed and all nodes up to Bug2.mpas should already be expanded). Double click Bug2.mpas. The following warning dialog is displayed:
File "D:\mP32_400_BugReport\Bug2\E:\mP32_400_BugReport\Bug2_Files\Bug2.mpas" does not exists or it has been renamed. Would you like to remove it from project?


Thank you

User avatar
filip.grujcic
Posts: 822
Joined: 14 May 2018 08:34

Re: v4.0.0 Missing files from project after closing project

#2 Post by filip.grujcic » 19 Feb 2019 15:58

Hello,

I will try to reproduce both issues and I will let you know what the outcome is.
Thank you for the detailed explanation.

Kind regards,
Filip Grujcic

Post Reply

Return to “mikroPascal PRO for PIC32 Beta Testing”