1

So I want to navigate the file system from within a Fiji script, and create files. macOS uses / as a separator while windows uses \ as a file separator. I can't for the life of me find an easy way to do this given the poor search ability of the documentation.

For example, in Matlab, I can use a built it variable filesep or ispc() or ismac() to find out.

Is there a similar function in imageJ?

Thanks

  • **You can use `/` as a directory separator character on Windows.** The only thing to watch out for is that paths start with `C:/` instead of just `/`. – Dai Feb 09 '21 at 04:13
  • So there isn’t an implementation similar to the one I’m looking for? Or this is the only workaround? – Omar Alamoudi Feb 09 '21 at 04:30
  • I don't know - I'm not an imagej user - but what I'm saying is that you don't need any workarounds because `/` will work on Windows. – Dai Feb 09 '21 at 04:34
  • Fair enough, thanks – Omar Alamoudi Feb 09 '21 at 04:36

1 Answers1

0

I just found the answer. Using Fiji, you can use File.separator.

See further documentation here