Login  Register

difference in dir list WinXP and Linux

Posted by Tycho Scholtens on Jan 20, 2006; 3:25pm
URL: http://imagej.273.s1.nabble.com/difference-in-dir-list-WinXP-and-Linux-tp3703981.html

Hello all,

 

I'm using a macro that analyzes images from 4 directories.

It is important that the same file (when sorted by filename) is loaded from
all 4 directories.

When I run the macro pasted below in WinXP it gives the correct listing.
However, when I run it in Linux (RH 9.2) it gives a different order of the
files.

Is this a common problem and related to it, how can I sort an array of
strings in ImageJ (a simple sort() doesn't seem to work).

 

Macro:

dir = getDirectory("Choose main directory to analyze");

dir_ch1 = dir+"Channel 1/";

dir_ch2 = dir+"Channel 2/";

dir_ch3 = dir+"Channel 3/";

dir_ch4 = dir+"Channel BF/";

list_ch1 = getFileList(dir_ch1);

list_ch2 = getFileList(dir_ch2);

list_ch3 = getFileList(dir_ch3);

list_ch4 = getFileList(dir_ch4);

n = list_ch1.length

for (i=0; i<n; i++) {

            print(list_ch1[i]);

            print(list_ch2[i]);

            print(list_ch3[i]);

            print(list_ch4[i]);

}

 

Regards,

 

-----------------------------------------------------
Ir. Tycho Scholtens
Biophysical Engineering
Faculty of Science and Technology
University of Twente
P.O. Box 217
7500 AE Enschede
The Netherlands
Tel.: +31 (0) 53 489 2004
 
<http://by18fd.bay18.hotmail.msn.com/cgi-bin/compose?curmbox=F000000001&a=9c
73dd4dd02727df3cbc1ae5ce6f66a0c1278c3e949b7730438420053193ec8f&mailto=1&to=t
.[hidden email]&msg=MSG1134382365.1&start=20682793&len=2184&src=&type=
x> [hidden email]
 <javascript:ol('http://www.tnw.utwente.nl/bpe/');>
http://www.tnw.utwente.nl/bpe/