Login  Register

Re: bug report: -batch command adds txt extension and macros directory automatically

Posted by Carnë Draug on Mar 15, 2014; 8:47pm
URL: http://imagej.273.s1.nabble.com/bug-report-batch-command-adds-txt-extension-and-macros-directory-automatically-tp5006916p5006936.html

On 15 March 2014 18:56, Rasband, Wayne (NIH/NIMH) [E]
<[hidden email]> wrote:

> Dear Carnë,
>
> On Mar 14, 2014, at 9:28 AM, Carnë Draug wrote:
>
>> Hi
>>
>> The title says it all. It would appear that ImageJ automatically adds
>> a txt extension when there is none, even if the file without file
>> extension exists. How to reproduce
>>
>> 1) create a simple macro
>>
>> $ echo 'print ("Hello world!");' > ./macro_test
>>
>> 2) get an error from ImageJ about file not existing
>>
>> $ ImageJ-linux32 -batch macro_test
>>
>> Macro or script not found:
>>
>> $path for imagej$macros/macro_test.txt
>>
>> Note that this works fine if the file exists in the current directory
>> with a txt file extension. A temporary workaround for this is to use
>> "-batch ./macro_test" but I don't think that ImageJ should be trying
>> to make any guess at all. Anyone calling through the command line
>> should know how to specify the path for the macro file. And even if it
>> should be guessing, then it should only do it after checking if the
>> file does exist in the current directory.
>
> This bug should be fixed in the latest daily build (1.48t14).
>
> Best regards,
>
> -wayne

Hi

I confirm this is also fixed using 1.48t14 via FIJI.

For future reference, the new behaviour when the file has no file extension is:

1) macros directory with the txt extension
2) macros directory with ijm extension
3) macros directory without extension
4) current directory without file extension
5) current directory with txt extension
6) current directory with ijm extension

Thank you,
Carnë

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html