© Copyright Clive E. Chapman 2008. All rights reserved.

Using FL on Linux

Version 5.00 (2008-07-25)


Contents

This page Other pages
Overview Main Page
DOSEMU Licence
HX DOS Extender FL User Guide
Wine Console FLCUST User Guide
  FLFIND User Guide
  FLTREE User Guide
  FLVIEW User Guide
  TEE User Guide


Overview

In the current version of the FL Tools there is no version of FL that runs natively on Linux. However, there are three ways that FL for another operating system can be used on Linux:

Linux tool FL version
DOSEMU FL for Windows 95
HX DOS Extender FL for Windows
Wine Console FL for Windows

These are described below.

[Back to Contents]


DOSEMU

As its name suggests, DOSEMU emulates the DOS environment on Linux. You might expect that you would run "FL for DOS" on DOSEMU. You can indeed do this, but there is a better alternative, namely "FL for Windows 95".

"FL for Windows 95" is a version of FL that was developed for Windows prior to the development of the native 32-bit version ("FL for Windows"). "FL for Windows 95" is an adaptation of "FL for DOS", and includes support for long file names. DOSEMU also supports long file names, and so "FL for Windows 95" is the perfect match for DOSEMU.

DOSEMU is an excellent emulation of DOS, but, of course, it suffers from the limitations of DOS, and in particular from the DOS memory constraints. The consequence of this is that you will be limited in terms of the number of files that you can list in FL, and what applications you can invoke from the FL command line.

"FL for DOS" can list 4000-5000 files when running on native DOS with relatively few drivers or TSRs loaded, and around 2000 files when running on DOSEMU. "FL for Windows 95" can list around 1400 files when running on DOSEMU.

When "FL for Windows" was completed, "FL for Windows 95" was no longer needed, and it is not included with the FL Tools. However, "FL for Windows 95" remains available, and can be requested from the FL maintainer.

After you have downloaded and installed DOSEMU, you can start DOSEMU from any directory by using the following command in a Linux command window:

dosemu

DOSEMU creates a DOS command window where you can enter DOS commands. In the DOS window, change to the directory where you installed the FL files (see below), and invoke "f.bat" as usual (brackets [ ] indicate optional items):

f.bat [[drive][path][name[.[ext]]]] [...] [options]

You can now navigate the directory tree as normal, enter DOS commands to operate on the files, and exit either to the directory on show (#C command), or to the original directory (#Q command).

To exit from DOSEMU, enter the following command in the DOS command window:

exitemu

Usage Notes

  1. The version of DOSEMU tested was 1.4.0.0.

  2. DOSEMU sets up the following configuration by default:

    Drive Contents
    C: Notional DOS drive
    D: Home directory
    E: Root directory
    Z: DOSEMU drive

    If you installed FL in a sub-directory within your home directory, that directory will reside on the D: drive.

  3. The way that FL determines the name of the file system on DOS cannot be used on Linux, and so the file system name always appears as "???" on DOSEMU. The drive sizes are also likely to display as zero.

  4. It appears that DOSEMU fails to preserve the return code from commands. As a result, FL is unable to detect when a command returns a non-zero return code.

[Back to Contents]


HX DOS Extender

The HX DOS Extender is a tool that allows specially-written DOS programs to access more memory than conventional DOS allows. However, compared to other DOS extenders that exist, HX also performs the following trick: it allows native 32-bit Windows console applications to run. This means that it can run "FL for Windows" on native DOS, and also on DOSEMU on Linux; this circumvents the memory restrictions of "FL for Windows 95" on DOSEMU. However, the applications that you invoke from the FL command line must generally be Windows console applications (HX has only limited support for running graphics applications).

The HX DOS Extender can be obtained here:

Usage Notes

  1. The version of HX tested was 2.13a, but with updated versions of "dkrnl32.dll" and "dpmild32.exe" for improved NLS support.

  2. FL determines information about the current drive by using a Windows function, but HX currently returns incorrect information. As a result, FL displays nonsense values for disk size, free size, and used size, blanks for the drive label, and "???" for the file system name.

[Back to Contents]


Wine Console

Wine is a tool that provides a Windows environment on Linux. There are two subsystems:

By using Wine Console, you can run "FL for Windows" on Linux. Wine Console's emulation of the Windows console environment is inferior to DOSEMU's emulation of the DOS environment, but Wine Console is nevertheless a usable solution (mostly).

"FL for Windows" contains some fix-ups that are needed for FL to run on Wine Console, but these are not activated by default – you need to set some environment variables to activate this support. A ZIP file is included with the FL tools that contains the additional files needed for Wine Console; these files are:

After you have downloaded and installed Wine, do the following:

  1. Unzip the file "flwin.zip" and copy the files to the directory that you want to use to store the FL tools.

  2. Unzip the file "fllin.zip" and copy the files to the directory used in the preceding step. You must do this after the preceding step, as some of the files in "fllin.zip" are intended to replace those that were in "flwin.zip".

  3. Use the Linux "chmod" command to give relevant files the "executable" attribute, like so:
    chmod +x console.sh
    chmod +x f.bat
    chmod +x ff.bat
    chmod +x flwine.bat
    chmod +x fl.exe
    chmod +x flcust.exe
    chmod +x flfind.exe
    chmod +x flview.exe
    

    Note: FLTREE is not included above, as the version included with "FL for Windows" is the DOS version, and will not work on Wine Console,

Usage Notes

  1. The version of Wine Console tested was 0.9.44-15.

  2. Wine Console sets up the following configuration by default:

    Drive Contents
    C: Notional Windows drive
    X: Wine Console drive
    Y: Home directory
    Z: Root directory

  3. The version of Wine Console tested with FL has a fatal bug that manifests itself when Wine Console is started with default settings. This bug can be circumvented by using the "--backend=user" option; the shell script "console.sh" does this for you.

    To start Wine Console, go to the directory where you have stored the FL tools, and enter the following command in a Linux command window:

    ./console.sh

    Wine Console will start and create a Windows command window. In this window, invoke "f.bat" as you would on Windows (brackets [ ] indicate optional items):

    f.bat [[drive][path][name[.[ext]]]] [...] [options]

    You can now navigate the directory tree as normal, enter Windows commands to operate on the files, and exit either to the directory on show (#C command), or to the original directory (#Q command).

  4. You may need to modify the file "flwine.bat" to suit your set-up and preferences. This file does three things:

    • "flwine.bat" activates the Wine Console fix-ups within FL:

      set fl_linux_wine=1

      Set this variable to zero ("0") if you want to deactivate the Wine Console fix-ups.

    • "flwine.bat" specifies the character that you want to use to prefix commands that are native Linux commands:

      set fl_linux_prefix=@

      This defines the At ("@") character as the Linux prefix. You can choose any character which is not alphabetic, numeric, the FL command prefix, the FL command repeat character, or the no-echo line prefix ("!").

      You use the Linux prefix to cause FL to convert filespec parameters from Windows syntax ("d:\pqr\xyz\name.ext") to Linux syntax ("/abc/def/pqr/xyz/name.ext"). The Linux command invoked then receives filespecs in the syntax that it is expecting (see below for more details).

    • "flwine.bat" specifies how FL should map drive letters in Windows filespecs to directories in the Linux file system (in the lines below, the ellipsis "..." indicates where a line has been split to fit on the page):

      set fl_linux_c_drive=...
          .../home/%username%/.wine/dosdevices/c:/
      set fl_linux_x_drive=...
          .../home/%username%/.wine/dosdevices/x:/
      set fl_linux_y_drive=/home/%username%/
      set fl_linux_z_drive=/

      The definitions in "flwine.bat" provided with the FL Tools correspond to the default setup that Wine Console creates for you. If you customise Wine Console to recognise other drive letters, you must modify "flwine.bat" correspondingly (you can define all drives from A: to Z: in "flwine.bat").

  5. When a command is prefixed with the Linux prefix, FL parses the command using double quotes and blanks as parameter delimiters, with double quotes taking precedence. FL then examines the parameters of the command, and any that "look like" Windows filespecs are converted to Linux filespecs.

    If you specify the filespec of the command itself, it must be in Windows syntax, even if the command is a Linux command. For example, to invoke the Linux "cp" command to copy a file, you must use syntax like this:

    @z:\bin\cp "source file" "target file"

    For the command parameters, FL treats a parameter as a filespec if any of the following conditions is true (note: quotes are used below to delimit the strings in this document; they are not included in the tests that FL performs):

    • Parameter is a drive, or begins with a drive.
    • Parameter contains a backslash.
    • Parameter is "." or "..".

    A drive is an upper case or lower case letter followed by a colon.

    If FL decides that a parameter is a filespec, FL resolves the possibly-incomplete filespec to a complete filespec, and then converts it to Linux syntax. Other parameters are not altered.

    Note that you must prefix each Linux command with the Linux prefix, and not merely the FL command line. Remember that an FL command line can contain two or more commands, connected by FL command joiners. For example, you might define your "View" function key as follows:

    !#r #\*.* #|| @z:\opt\kde3\bin\kwrite #

    where "#" is your FL command prefix character, and "@" is your Linux prefix character.

  6. The "~" notation that denotes the home directory is not recognised as such by FL; instead you must use the Y: drive (which is the drive that Wine Console allocates by default for the home directory).

  7. Using FL synonyms for Linux commands is a simple way of concealing both the Linux prefix, and the path in Windows syntax that leads to the command. For example, you could define the following synonyms:

    Synonym Replacement text
    copy @z:\bin\cp
    cp @z:\bin\cp
    k @z:\opt\kde3\bin\kwrite

  8. Some applications invoked from the FL command line run asynchronously as detached processes (KWRITE is like this). As a result, FL never sees the return code that the application eventually sets on exit.

  9. There are some restrictions on the action of those FL commands that operate on files and directories:

    • The #FILE, #NAME, and #EXT commands cannot be used to change only the letter case (upper or lower) of one or more letters in the file name or extension (for example, changing "bat" to "Bat"). It is not clear where this restriction arises (since this can be done in Windows), but it is probably in the Wine Console service layer, where it has to have some rule for mapping the case insensitive filespecs provided by the Windows application into the case sensitive filespecs stored by the Linux file system.

      To change only the letter case of a name or extension, you must first change the name or extension to something else, and then change it to the desired value.

    • The #ATTR command cannot be used to turn on or off the A, H, or S attributes. After the command has been executed, the list will show the new setting, but the file on disk has not been altered (so the attributes revert to their previous values when the list is regenerated).

      In contrast, the R attribute can be turned on or off with permanent effect.

    • The #DATE and #PATH commands work correctly.

  10. Various of FL's user-definable keys are not available on Linux:

    • On Windows, the ALT or ALT-GR key can be used to access those FL functions assigned to the ALT shift. On Linux, only the ALT key can be used.

    • Certain of the ALT or CTRL function keys may be pre-empted by the operating system or windowing system. For example, KDE3 on Open SUSE 10.3 uses CTRL-F1 and CTRL-F2 to switch between desktops 1 and 2, and FL never sees the keystrokes.

  11. On Linux, the convention is that files and directories beginning with a dot are hidden, and are not shown by default. Since FL shows all files and directories by default, these hidden files and directories appear in the list.

    The FL way to omit hidden files is to use the "/A:-H" attribute selection option on the #A, #R, or #W commands, but Wine Console does not return the correct file attributes for this to work.

  12. On Linux, filespecs are case sensitive. You may therefore want to set the profile option "Case sensitive sorts" to "yes" in FLCUST.

  13. Wine Console does not provide FL with the correct file system name – the file system name will appear as "NTFS", even when it is actually "ext2" or "ext3" (or some other file system).

  14. For some reason Linux, KDE, or Wine Console reverses two of the colors that form part of the set of sixteen base colors, thereby making it different from DOS, OS/2, and Windows. The color which FL calls "dark grey" is rendered as light grey on Wine Console, and the color which FL calls "light grey" is rendered as dark grey on Wine Console.

  15. Wine Console does not use the correct character set for Windows console applications; in particular, Wine Console uses a character set which lacks the extended graphic characters that are available on DOS, OS/2, and Windows. Consequently, characters such as box corners, continuous double horizontal lines, and up/down/left/right arrows are rendered either as approximations. or as unrelated characters. This is particularly noticeable in FLCUST.

  16. Using tree mode in FL requires some caution. Tree mode in your home directory will probably work fine, but tree mode from the Linux root directory does not work – the activity bar continues indefinitely, or alternatively may come to a complete stop (both have happened when testing this on the author's Open SUSE 10.3 system). This has been investigated, but without reaching a conclusion.

    Initially it was thought that symbolic links in the file system were causing a circular directory tree. For example, this could occur if a link within sub-tree A pointed to the top of sub-tree B, whilst a link within sub-tree B pointed to the top of sub-tree A. FL would traverse such a tree indefinitely. Although such a tree can be created, tests show that Linux prevents a circular tree by suppressing the link that would result in a circular reference (presumably by noticing that the link points to a directory that is already in the current path).

    It might be thought that the problem is caused by the Linux file system containing too many files for FL to list, but this is unlikely. The only implementation limit that FL has is a limit on the number of files; this limit is circa one billion (in fact, a few less than two to the power of thirty). In practice you will run out of memory (RAM) before FL runs out of capacity. The author has successfully used FL to list 4.2 million files on Windows, on a machine with 2GB of RAM; the file list occupied 1.55GB.

    Further investigation showed that not all directories in the root directory cause a problem – specifically only "etc" and "sys" cause a problem. The source of the problem remains a puzzle.

  17. No cursor is visible in text-entry fields in FLCUST.

  18. Please note that only FL.EXE has been modified to allow it to work on Wine Console. The other tools in the package have not been altered, and as a result may not work correctly.

[Back to Contents]


Valid HTML 4.01 Page last changed: 2008-07-25 Valid CSS