Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] How to find out, whether we are running on Cygwin

Hi Norbert,

 

One way of solving your problem could be to check whether you are running on windows and the paths starts with “/” and if so, perform path conversion, i.e:

if (Platform.getOS().equals(Platform.OS_WIN32) && path.startsWith("/")) { //$NON-NLS-1$

      .. Do path conversion here.

 

See e.g. org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator as a reference.

 

Regards,

Mikhail

 


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Ploett, Norbert
Sent: Monday, September 04, 2006 2:36 PM
To: CDT General developers list.
Subject: [cdt-dev] How to find out, whether we are running on Cygwin

 

Hi folks,

 

I am trying to create a demo implementation for the "external problem markers" bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=151005

 

I can nicely get the path for an external problem from gcc in a format like "/usr/include/myheader.h" - even when running on cygwin. So this path is perfectly ok on Linux but on windows I need to translate first. Question: How can I detect "somewhere in the CDT" whether I am on cygwin and need to translate or on Linux and can use the path directly?

 

I could of course, test whether the file exists and translate if it does not. But perhaps there is something smarter?

 

Thanks,

 

 

Norbert

 

 


Back to the top