> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Portability

> [accordion] broken-input-line
>
> 'input\_line' leaves a '\r' (CR) character when reading lines from a Windows text file, whose lines end in "\r\n" (CRLF). This is a problem for any Windows file that is being read either on a Unix-like platform or on Windows in binary mode. If the code already takes care of removing any trailing '\r' after reading the line, add a '(\* nosemgrep \*)' comment to disable this warning.

> [accordion] prefer-read-in-binary-mode
>
> 'open\_in' behaves differently on Windows and on Unix-like systems with respect to line endings. To get the same behavior everywhere, use 'open\_in\_bin' or 'open\_in\_gen \[Open\_binary]'. If you really want CRLF-to-LF translations to take place when running on Windows, use 'open\_in\_gen \[Open\_text]'.

> [accordion] prefer-write-in-binary-mode
>
> 'open\_out' behaves differently on Windows and on Unix-like systems with respect to line endings. To get the same behavior everywhere, use 'open\_out\_bin' or 'open\_out\_gen \[Open\_binary]'. If you really want LF-to-CRLF translations to take place when running on Windows, use 'open\_out\_gen \[Open\_text]'.

> [accordion] not-portable-tmp-string
>
> You should probably use Filename.get\_temp\_dirname().


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.