hen downloading text files from the internet these files often have the wrong line breaks
because the line breaks are of the type of the server's operation system. While Unix
systems use a single "Line Feed" to mark the end of a line DOS and Windows systems use a
"Carriage Return" followed by a "Line Feed".
his program will convert line breaks from Unix format (LF) to DOS format (CR/LF). It
also shows how to handle command line arguments and how to convert short file names to
long file names.
Unix to DOS
his program expects a file name as command line argument. If this file name is missing
then it prompts the user to specify a file. When using Drag&Drop (drawing a file on this
program's icon) Windows will pass the dropped file's name in short file format. When
writing back the file it would turn to the short file name. So the file name argument
has to be converted to long file name format first.
'Author : Daniel, Master Sourcerer at Kitana's Cas...
'Last change: January 30, 2004
'Email : firstname.lastname@example.org
'Replaces Unix lines breaks (LF) with DOS line breaks ...
'read file name
IF F$=""THEN 'no file name specified so prompt user
LINE INPUT"File to convert: ",F$
IF F$=""THEN EXIT FUNCTION
'check if file exists and get its long file name
F$=DIR$(F$) 'DIR$ converts short file names to long...
PRINT"File not found"