Re: AW: ROI intersection

Posted by Wayne Rasband on
URL: http://imagej.273.s1.nabble.com/ROI-intersection-tp3701011p3701015.html

> How can I rename a file without opening it ?

The macro language in v1.38b, due later this week, has a File.rename()
function. This example changes the name of the file "map.tif" on my
desktop to "map2.tif".

    File.getAbsolutePath("");
    dir = "/Users/wayne/Desktop/";
    File.exists(dir+"map.tif");
    File.length(dir+"map.tif");
    File.isDirectory(dir+"map.tif");
    File.rename(dir+"map.tif", dir+"stack/map2.tif");

Here is the "Log" window output:

     /Users/wayne/java/source  [default directory]
    1  [exists() returns true]
    307968  [length in bytes]
    0  [isDirectory() returns false]
    1  [rename() returns true]

-wayne