开发者

What are the difference between Cygwin on Windows and real UNIX environment

I am a C/C++ developer. I have never done C++ programming on UNIX, I have done only on windows.

I want to practice C++ on Unix. (Because all big companies ask C++ with Unix).

I have a laptop on which I do not want to install any other OS (because I have installed very important software on it and I don't ha开发者_如何学Cve setups)

So, I searched and found CygWin which is Unix emulator for Windows. I am thinking to practice C++ on this.

What will be the difference between Unix and Cygwin?


Cygwin is mainly a POSIX emulator - where POSIX is some lowest common denominator of UNIX and other systems. This makes it possible to have cleanly written POSIX applications running on Windows.

You will find all things that are specified in POSIX (like the filesystem hierarchy, /proc filesystem, signals, sockets) in cygwin as well and it will behave within the POSIX specs. But as lots of things are unspecified in POSIX, it will not be 100% like any other real Unix system.

For example, on most UNIX systems, you can delete a file while it is open (which will make it a temporary file without name which will be deleted when the last user closes it). Windows does not allow this (and POSIX does not mandate it either); so on Cygwin you will have Windows file semantics (you cannot delete a file while it is open).

Same goes for allowed characters in filenames, filename case sensitivity, and (of course) all the additional APIs (besids POSIX) that most real UNIXes offer but which are not included in Cygwin.

(At least you can have a X server in Cygwin, which does again only support the basic X operations).


Cygwin just has a subset of the functionality of a real Unix OS and there are certain things which you need to know about the Unix OS that cygwin will not tell you. It depends what you need to be able to do on a unix machine. As it has a different file system and doesn't have the same directory structure as Windows. For example there isn't a 'Program Files' in Unix, and you may need to know where a lot of files are situated, which you will not find out with cygwin. Though I do agree, if you don't want to install another OS on your machine, you can install it in a Virtual machine, or to simply use it every now and then you could simply use a liveCD


You may find this link helpful: http://en.wikipedia.org/wiki/Cygwin

They provide a lot of useful information to help you better understand what will be going on.

My advice would be to virtualize your own environment (with Ubuntu inside Virtual Box for example). Google them to get the download links

You can experiment to your heart's content.


Download VirtualBox, then install a Unix flavour of your choice. Personally, I'm a big fan of Ubuntu. :)

Though Cygwin is pretty great at what it does, it's not going to be the same as working directly on a Unix machine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜