|© Copyright Clive E. Chapman 2008. All rights reserved.|
|This page||Other pages|
|HX DOS Extender||FL User Guide|
|Wine Console||FLCUST User Guide|
|FLFIND User Guide|
|FLTREE User Guide|
|FLVIEW User Guide|
|TEE User Guide|
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.
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 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:
|C:||Notional DOS drive|
If you installed FL in a sub-directory within your home directory, that directory will reside on the D: drive.
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:
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:
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,
|C:||Notional Windows drive|
|X:||Wine Console drive|
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:
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).
Set this variable to zero ("0") if you want to deactivate the Wine Console fix-ups.
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).
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").
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):
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.
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.
In contrast, the R attribute can be turned on or off with permanent effect.
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.
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.
|Page last changed: 2008-07-25|