Top "Portability" questions

Portable code can be run with little to no modification in multiple environments.

Is there a portable way to get the current username in Python?

Is there a portable way to get the current user's username in Python (i.e., one that works under both …

python portability username
Is there a replacement for unistd.h for Windows (Visual C)?

I'm porting a relatively simple console program written for Unix to the Windows platform (Visual C++ 8.0). All the source files …

c++ c windows portability unistd.h
How do SO_REUSEADDR and SO_REUSEPORT differ?

The man pages and programmer documentations for the socket options SO_REUSEADDR and SO_REUSEPORT are different for different operating …

linux windows sockets unix portability
How to measure time in milliseconds using ANSI C?

Using only ANSI C, is there any way to measure time with milliseconds precision or more? I was browsing time.…

c portability time-precision
How should I print types like off_t and size_t?

I'm trying to print types like off_t and size_t. What is the correct placeholder for printf() that is …

c portability format-specifiers
Using Python's ftplib to get a directory listing, portably

You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is: # …

python ftp portability
OS specific instructions in CMAKE: How to?

I am a beginner to CMAKE. Below is a simple cmake file which works well in mingw environment windows. The …

c++ linux cmake mingw portability
Multi-character constant warnings

Why is this a warning? I think there are many cases when is more clear to use multi-char int constants …

c++ c casting compiler-warnings portability
How to Declare a 32-bit Integer in C

What's the best way to declare an integer type which is always 4 byte on any platforms? I don't worry about …

c portability
How to bundle a JRE with Launch4j?

I have Launch4J on my computer and it's a great program. One of its features I'm interested in is …

portability exe java launch4j