I have created a project with some files and configured an external compiler.
The compiler is actually a script that works like a makefile: when the files'
modification dates change the real compiler is called.

However, while working with PSPad, I noticed that it writes to the current file
every time I call the compiler, even if the file was not modified and even
leaving the option "Save all files before compilation" turned off. That makes my
script somewhat inneficient.

I'd expect the program to save the file only when the option mentioned above is
checked and there really are changes to be saved.

Steps to reproduce:

1. Create a temporary directory
2. Create an empty text file named test.txt inside it
3. Create a python script like this* and call it build.py:
[color=green]
import datetime
import os.path
print
datetime.datetime.fromtimestamp(os.path.getmtime('test.txt'))
[/color]
4. Open PSPad, click Projects->Create project from directory and select the
directory you just created
5. Go to Project Settings->Compiler and set the following:
   - "Compiler" to the python exeutable
   - "Parameters" to build.py
   - Leave "Save all files before compilation" unchecked
   - Check "Capture program output window"
6. Now open the file test.txt through the project's panel
7. Press Ctrl+F9
8. Press again: note how the modification time changes whenever you press the
keys

* If you don't have python create a batch file that does a "dir test.txt". Then
wait until the minute of the clock changes to press Ctrl+F9 again

Tested with build 4.5.1 (2207)

-- 
<http://forum.pspad.com/read.php?4,34846,34846>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem