Creating and Replacing Data Files

Use the CREATE, REPLACE or SAVEAS primary commands to specify a file to be written from the data being edited. CREATE writes a new file while REPLACE rewrites a file if it exists, or creates it if it does not already exist. The SAVEAS command will create a new file and immediately switch the current Edit Tab to the newly created file. The process of creating and replacing data is very similar. However, remember that when you replace data, the original data is deleted and replaced with the new data.


SAVEAS always writes the entire contents of the edit file, but the CREATE and REPLACE commands can use all the selection capabilities of the line-range-operands to specify what lines are to be written.


When a SAVE command is issued for a newly created file that does not yet have a name (you will know this by the file-tab label of (Empty) for this file), you will see the same file-saving dialog that you will see when SAVEAS is used.  A window will appear with a title of Specify file to SaveAs, where you can enter the new file's name.


Enter CREATE, REPLACE or SAVEAS on the Command line, followed by the name of the file to be created or replaced. For the CREATE and REPLACE commands you can also use all the selection capabilities of the line-range-operands to specify what lines are to be written.  If you omit the line numbers, you can use the C/CC or M/MM line commands  to specify which lines are to be copied or moved.  Then press Enter.


If you omit the file name with the CREATE, REPLACE or SAVEAS commands, the editor displays a standard Windows Save As dialog requesting the file name you want created or replaced.

When no operand at all or only a simple unqualified filename is provided for the CREATE command, the default directory used for writing the file or for the file open dialog's starting directory will be determined as follows:




In addition to these commands, you can save every open edit session by using the SAVEALL command.  See  SAVEALL - Save All Current Tabs for more information.


Restricted file names under Windows


Because of limitations in Windows that go all the way back to the early DOS days, you are prevented from creating files having any of the following base names:


CON, PRN, AUX, CLOCK$, NUL

COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9

LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9


For example, you cannot create a file called NUL, NUL.TXT or NUL.MACRO.


In addition, you are prevented from creating files on an NTFS file system having any of the following names:


$Mft, $MftMirr, $LogFile, $Volume, $AttrDef, $Bitmap, $Boot, $BadClus,

$Secure, $Upcase, $Extend, $Quota, $ObjId, $Reparse


It would not be impossible for SPFLite to circumvent these limitations, but doing so would cause other problems.  We have chosen not to support these names, because in practice there is little demand for them.


Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease