Far Manager Documentation

repository·master·Indexed 24 days ago

https://github.com/fargroup/farmanager

A text-mode file manager for Windows featuring a plugin-based architecture. Documentation covers the Plugins API and Lua API, command-line switches for runtime configuration, installation of .farconfig and .lua scripts, and build instructions for the MSI installer and Encyclopaedia (.CHM). It also includes technical details on SQLite configuration and the FExcept exception handler.

Tokens
14.3K
Snippets
20
Records
95
Agent score
78%

What's inside Far Manager

  1. What is Far Manager?

    master

    Far Manager is a file and archive management program for Windows operating systems. It operates in a text-based mode and provides an intuitive interface for common file system tasks, including:

    • Previewing files and folders
    • Editing, copying, and renaming files
    • Various other file operations
  2. Overview of Far Manager

    master

    Far Manager is a console-based file manager for Windows operating systems. It provides a user interface for interacting with real and emulated file systems and files. Key capabilities include:

    • Viewing files and directories.
    • Editing, copying, and renaming files.
    • Multilingual and highly customizable interface.
    • Color-coded navigation and file sorting groups.
  3. Use the Unicode Lua Interpreter (lfjit.exe)

    master

    lfjit.exe is a Unicode-aware Lua interpreter that functions identically to the standard luajit.exe but includes enhanced support for Unicode through additional libraries and specialized function versions. It is dynamically linked with lua51.dll and luafar3.dll.

    Key Differences from standard LuaJIT:

    • Additional Libraries: Includes bit64, utf8, and win.
    • Unicode-enabled io library: Uses a Unicode version of the standard io library.
    • Unicode-enabled loading functions: loadfile, require, and package.loadlib are Unicode-aware.
    • String Method Redirection: When calling methods on strings using the : syntax (e.g., str:method()), the interpreter accesses the utf8 table instead of the standard string table.

    Limitation: The command line interface (CLI) itself is non-Unicode.

  4. Understand the difference between zlibwapi.dll and zlib1.dll

    master

    There are two primary DLL builds available for zlib:

    1. zlibwapi.dll: Uses the WINAPI calling convention. It includes minizip functionality. Requires the ZLIB_WINAPI macro during compilation.
    2. zlib1.dll: The official DLL build that exports functions using the CDECL convention.

    Warning: Do not define the ZLIB_DLL macro used in zlib 1.1.x, as it has a different effect in this version and may cause compatibility issues.

  5. Use the pcre++.h C++ wrapper for PCRE

    master

    The libpcre directory contains source code for PCRE 4.4, modified for Win32 compatibility. It includes a C++ header named pcre++.h which provides wrapper classes for easier use of PCRE in C++ projects.

    Note: This is a custom wrapper specifically designed for use in MultiArc; it does not use the STL (Standard Template Library). Do not confuse this with the standalone PCRE++ library.

  6. Extend Far Manager with DLL plugins

    master

    Far Manager's functionality can be significantly extended using external DLL modules (plugins). These plugins are created using a specific set of interfaces available via the Plugin API.

    Common features implemented as plugins in the standard distribution include:

    • Archive support
    • FTP client
    • Temporary panel
    • Web browser
    https://api.farmanager.com/
  7. Use ZLIB API in ILE RPG

    master

    For ILE RPG programmers, ZLIB provides a /copy member that defines the API prototypes.

    This member can be found at: ZLIB/H(ZLIB.INC).

    Important Note on Data Encoding: Most foreign textual data is ASCII coded. This implementation does not handle automatic conversion between ASCII and EBCDIC. You must perform text data code conversions explicitly before using the ZLIB API.

  8. How MultiArc handles nested archives via GetSFXPos

    master

    MultiArc uses the GetSFXPos function to correctly identify the start of an archive within a larger file stream.

    When IsArchive recognizes a format, MultiArc immediately calls GetSFXPos. It then compares the offsets returned by all loaded FMT modules and selects the one with the lowest offset (the one closest to the beginning of the file).

    This mechanism allows Far Manager to correctly identify an archive that is embedded inside another (for example, an uncompressed ARJ archive stored inside a ZIP file), preventing the outer container from always taking precedence.

  9. Extend Far Manager functionality with Plugins

    master

    Far Manager's core functionality can be significantly expanded using external pluggable DLL modules (plugins). Many standard features, such as archive handling, FTP clients, temporary panels, and network viewing, are implemented via plugins.

    Developers can build their own extensions by using the official Plugins API.

  10. Use the zlibpas Pascal interface

    master

    The zlibpas unit provides a Pascal (Delphi, Kylix) interface to the zlib data compression library.

    Key Integration Details

    • Naming Conflict: Do not confuse zlibpas with Borland's built-in ZLib unit. The Borland ZLib unit is a suite of class wrappers that lacks essential features like checksums. Use zlibpas for full-fledged zlib functionality.
    • Calling Convention: The interface uses the cdecl keyword. This means it is compatible with modern Delphi/Kylix environments but will not work with old Turbo Pascal.
    • Type Mapping: C and zlib types are translated to Pascal types of similar sizes to avoid namespace pollution (e.g., int to Integer, long to LongInt). Note that unsigned integers are not explicitly converted to Pascal unsigned integers.
    • gz Functions*: The gz* function interfaces are not translated into Pascal to avoid C runtime library interfacing issues and because functions like gzprintf cannot be directly translated.