PFE Logo

Application Note 7

UNIX File Format Lost After A Save As Operation

When you're working with files that you save in UNIX file format, you may experience times when PFE apparently spontaneously resets the format (which is displayed in the Status Bar) when you perform a File Save As operation.

The reason for this behaviour is the way the File Modes operate and interact with file names.

Consider what happens when you're editing a file that on disk is held as a UNIX format file, with LF as the line terminator.

When you load the file, PFE by default will auto-detect the format, and will treat the file internally as being in UNIX format - you'll see the word UNIX appearing in the format field of the status bar.

When you do a File Save operation (not a File Save As) PFE will simply write the data to disk in UNIX format and carry on; nothing about the file will change.

However, when you do a File Save As operation, things change. PFE will first save the file to disk in UNIX format, and then will examine the new file name that you've supplied. It looks in the details you've set up (or allowed to default) with the Edit Default Modes dialog, and adjusts the windows showing the file to match, altering things like the text colouring, the edit formatting and so on.

And here is the cause of the format change, because the format a file is saved in is also defined in these mode settings.

In versions prior to 0.07.002, PFE would apply all the modes matching the new filename to the file in memory, including the save format - hence you would commonly see the format change, apparently for no reason, from UNIX to DOS (the system default).

In version 0.07.002 this behaviour was modified, so that when you change a file's name, all the new modes except the file format are applied to it. You should thus be able to work happily without needing continually to correct the file's format after you've done a File Save As

Return to the PFE Home Page