heon21st / flashdevelop

Automatically exported from code.google.com/p/flashdevelop
0 stars 1 forks source link

Locked files after building project #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. [Embed(source="lock.txt", mimeType="application/octet-stream")] public var 
lock:Class;
2. Build project
3. Explore to project folder and try to delete lock.txt

Expected: File successfully deleted
Actual: Got error message "Java (TM) Platform SE binary" (see screenshot, sorry 
for cyrillic)

What version of the product are you using? On what operating system?
Reproduced on Windows7 32bit with FlashDevelop 4.0.0 RTM.

Please provide any additional information below.
It seems to be known issue: 
http://damehelp.dambots.com/index.php/Exporting#Troubleshooting

I made some investigation in public read-only sources and found some 
workaround. In file External\Plugins\ProjectManager\Actions\BuildActions.cs, 
insert after line 207 ("Environment.CurrentDirectory = directory;") following 
code:

// unlock all project files
string[] fileEntries = 
Directory.GetFiles(Path.GetDirectoryName(project.ProjectPath),
    "*.*",  System.IO.SearchOption.AllDirectories);
foreach (string fileName in fileEntries)
{
    string tmpContent = File.ReadAllText(fileName);
    if (!tmpContent.Contains("\0\0\0\0")) // binary check
    {
        File.Delete(fileName);
        File.AppendAllText(fileName, tmpContent);
    }
}

This code is quite raw, but I hope it will help to fix this issue corretly.

Original issue reported on code.google.com by nka1...@gmail.com on 18 Mar 2012 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
Your suggestion seem very brutal and may have bad side effects.

What happens if you reopen the project in FD or clean it?

Original comment by philippe...@gmail.com on 5 May 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Cleaning does not solves the problem, reopening FlashDevelop does. But it's too 
annoying to reopen project after each compilation.

Original comment by nka1...@gmail.com on 6 May 2012 at 12:23