You're on an interesting journey.
Languages typically give the programmer an API for access to all real resources.
Unless you are doing some major work, the platform (ie the OS) usually doesn't matter too much.
As an example the Java AWT 'abstracts' the interface to graphics
java.awt
Class Graphics
java.lang.Object
extended byjava.awt.Graphics
Direct Known Subclasses:
DebugGraphics, Graphics2D
see the
Class description
Likewise, the API for file access is abstracted
Specifically, C++ File I/O is very similary (different, but still abstracted)
It may be that your question implies, can I write code in language XXX that will run on ANY platform?
*MAYBE*. Java is designed to do just that, but in the real world, there's usually a tweek or two required as the product moves from one platform to another.
In this regard, many applications can be 'portable' when implemented in Perl or PHP,
which are not compiled languages, but intrepeted on the fly or with a just-in-time compliation (ie when executed).
To 'learn programming' per se, don't get confused between the Language and the Platform(OS); stay focused on the chosen language until you are ready to master multiple Operating Systems.