.FAR File Format

The File menu (Main window) allows you to Save/Open your FAR file list to/from a .FAR file. This topic provides extra info on the .FAR file format.

Standard .FAR file

File > Save command writes the current base directory to the [BASE_DIR] section, the current filter settings to the [FILTER] section, and the full path to every file list item to the [FILES] section.

[BASE_DIR]
base=C:\WINDOWS

[FILTER]
_opSkipDirs=1
_opSkipFiles=1
_opIncFiles=0
_opSkipDirsSL=_vti*|1|_private|1|
_opSkipFilesSL=.bak|1|.~*|1|.dcu|1|.ddp|1|.dof|1|.dsk|1|
_opIncFilesSL=

[FILES]
C:\WINDOWS\system32\nw16.exe
C:\WINDOWS\system32\nwapi16.dll

Standard .FAR file + Extra Info

In the File > Save dialog is a checkbox "Save extra info". When this is checked extra info (file list column data) is saved to an additional section [FILES_EXTRAINFO]. Item n contains extra info for item n of the [FILES] section etc. These sections always contain the same number of items.

[FILES_EXTRAINFO] item format: 1|2|3|4|5
   1: File size in bytes
   2: UTC file date/time part#1
   3: UTC file date/time part#2
   4: Replace Column data
   5: Match Column data

[FILES]
C:\WINDOWS\inf\acerscan.inf
C:\WINDOWS\inf\acerscan.PNF

[FILES_EXTRAINFO]
3237|$E23E000|$1C2F77D|-1|-1
10284|$EF5E6A48|$1C47C58|-1|-1

Sharing .FAR File - Path Specifiers

You can replace paths with Path Specifiers. This allows your .FAR files to work on any machine. Use find and replace to replace sections of the file path with the appropriate Path Specifier.

[FILES]
C:\WINDOWS\inf\acerscan.inf
C:\WINDOWS\inf\acerscan.PNF

can be written as

[FILES]
<windir>\inf\acerscan.inf
<windir>\inf\acerscan.PNF

When FAR loads this file it will expand the Path Specifiers. FAR does not use Path Specifiers when saving .FAR files.

Available Path Specifiers:
Specifier Example
<windir> c:\windows
<winsysdir> c:\windows\system32
<tempdir> C:\Documents and Settings\win xp\Local Settings\Temp
<driversdir>
 
c:\windows\system32\drivers
 
<csidlDesktop> C:\Documents and Settings\win xp\Desktop
<csidlPrograms> C:\Documents and Settings\win xp\Start Menu\Programs
<csidlPersonal> C:\Documents and Settings\win xp\My Documents
<csidlPersonal> C:\Documents and Settings\win xp\Favorites
<csidlStartup> C:\Documents and Settings\win xp\Start Menu\Programs\Startup
<csidlRecent> C:\Documents and Settings\win xp\Recent
<csidlSendTo> C:\Documents and Settings\win xp\SendTo
<csidlStartMenu> C:\Documents and Settings\win xp\Start Menu
<csidlDesktopDirectory> C:\Documents and Settings\win xp\Desktop
<csidlNethood> C:\Documents and Settings\win xp\NetHood
<csidlFonts> C:\WINDOWS\Fonts
<csidlTemplates> C:\Documents and Settings\win xp\Templates
<csidlCommonStartMenu> C:\Documents and Settings\All Users\Start Menu
<csidlCommonPrograms> C:\Documents and Settings\All Users\Start Menu\Programs
<csidlCommonStartup> C:\Documents and Settings\All Users\Start Menu\Programs\Startup
<csidlCommonDesktopDirectory> C:\Documents and Settings\All Users\Desktop
<csidlAppData> C:\Documents and Settings\win xp\Application Data
<csidlPrintHood> C:\Documents and Settings\win xp\PrintHood
<csidlLocalAppData> C:\Documents and Settings\win xp\Local Settings\Application Data
<csidlCommonFavorites> C:\Documents and Settings\All Users\Favorites
<csidlInternetCache> C:\Documents and Settings\win xp\Local Settings\Temporary Internet Files
<csidlCookies> C:\Documents and Settings\win xp\Cookies
<csidlHistory> C:\Documents and Settings\win xp\Local Settings\History
<csidlCommonAppData> C:\Documents and Settings\All Users\Application Data
<csidlWindows> C:\WINDOWS
<csidlSystem> C:\WINDOWS\system32
<csidlProgramFiles> C:\Program Files
<csidlMyPictures> C:\Documents and Settings\win xp\My Documents\My Pictures
<csidlProfile> C:\Documents and Settings\win xp
<csidlSystemX86> C:\WINDOWS\system32
<csidlProgramFilesCommon> C:\Program Files\Common Files
<csidlCommonTemplates> C:\Documents and Settings\All Users\Templates
<csidlCommonDocuments> C:\Documents and Settings\All Users\Documents
<csidlCommonAdminTools> C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools
<csidlAdminTools> C:\Documents and Settings\win xp\Start Menu\Programs\Administrative Tools
[DEFINE] Section

You can also use a [DEFINE] section to define your own path specifiers. So when you move between machines you only need to update the [DEFINE] section. Here FAR looks for the Specifier first in the [DEFINE] section before attempting to resolve it in the normal way (see above).

[DEFINE]
MyDir1=C:\program files\MyDir
ACMEDir=C:\program files\ACME
SomeLabel=<windir>

[FILES]
<MyDir1>\inf\acerscan.inf
<MyDir1>\inf\acerscan.inf
<ACMEDir>\inf\acerscan.PNF
<SomeLabel>\inf\acerscan.PNF

Note that SomeLabel points to <windir> which will be expanded when the file is loaded.

Finding directories by file association

This is something we use in house and is probably not very useful to you. A file extension is associated with a program that lives in a directory. Use a leading @ char to make FAR look up the directory associated with the file extension or COM GUID.

[FILES]
<@.psp>\inf\acerscan.inf

<@.psp> expands to folder "C:\Program Files\Paint Shop Pro 5"
Actually the "." is not required. ie. <@psp> would also work.

[FILES]
<@{F3A614DC-ABE0-11d2-A441-00C04F795683}>\winhelp.exe

FAR will lookup GUIDs in the registry and find the EXE or DLL associated with the GUID.
The GUID in this example is used my MSN Messenger and resolves to folder: "C:\Program Files\Messenger"

[DEFINE]
MyApp=<@{F3A614DC-ABE0-11d2-A441-00C04F795683};+msmsgs.exe=4.7>

[FILES]
<MyApp>\winhelp.exe

The GUID finds the messenger directory. If the directory contains msmsgs.exe v4.7.x.x then a valid directory name is returned otherwise the path remains as <MyApp>\...

[DEFINE]
MyApp=<@pcm;acm;+fred.exe=5;-greg.dat>

[FILES]
<MyApp>\winhelp.exe

Here FAR looks up the exe associated with file extension ".pcm". If not found it tries file extension ".acm". The exe folder found must contain fred.exe version 5.x.x.x but not contain file greg.dat. Again if a matching folder is not found then the result remains as <MyApp>\...

Rules available
.xxx Finds the exe (and thus the directory) associated with file extension .xxx.
If not found then nothing is returned and the path remains as <specifier>\...
xxx Same as .xxx
{xxxxxxxxxx} ActiveX GUID defined in the registry is associated with an EXE or DLL, and thus a folder.
-xx.xx Make sure file xx.xx is NOT found in the folder found so far
+xx.xx Make sure file xx.xx is found in the folder found so far
+xx.xx=v.v.v File is found and version is v.v.v.*
+xx.xx=v.v File is found and version is v.v.*.*
+xx.xx=v File is found and version is v.*.*.*
+{xxx} Folder of guid must be same
-{xxx} Folder of guid must NOT be same
+.xxx Folder of assoc exe/dll must be same
-.xxx Folder of assoc exe/dll must NOT be same
[..] A leading '[..]' returns one folder up. eg. [..].xxx;+xxx.xx returns c:\xx instead of c:\xx\xx
[...] A leading '[...]' returns two folders up.
[....] A leading '[....]' returns three folders up.

Q. What happens to Specifiers that cannot be expanded/resolved?
A. Specifiers are left as they are and displayed within the FAR file list.