spiralofhope logo
spiralofhope logo

S
piral of Hope
Better software is possible.
Styles
Table of Contents

Text Editors + DOSBox >


I decided to implement a DOS editor wrapper using DOSBox.

edit() {
  1. A Linux path to your dos stuff.
dosdir="/home/user/_public/live/dos/dos/"
  1. This is a path from the C: DOSBox mountpoint.
editor="C:\dos\edit.com"
  1. editor="C:\8088\utils\ted3.com"
  2. editor="C:\8088\utils\works\works.exe"
  3. create the file if it doesn't already exist?
  4. create=1
file=$1
  1. This routine is good for editors which complain about a file not existing
  2. first, like Microsoft Works 3.0
if [ $create -eq 1 ]; then
  1. If it doesn't exist
if [ ! -f $file ]; then
  1. Create it
echo : >> $file fi fi
  1. get the full path of $1
file=`readlink -f $file`
  1. now convert /path/to/file to the DOS-style \path\to\file
file=`echo $file|sed 's/\//\\\/g'` echo "D:$file"
  1. DOSBox doesn't like it if you mount the root.
  2. If some future version complains, then as root do something like:
  3. mount -o bind / /home/user/mounted-root
dosbox \ -c "mount d /" \ -c "mount c $dosdir" \ -c "c:" \ -c "$editor D:$file" \ -c "exit" }

todo

Long filenames are truncated automatically. Create a workaround:

Long paths explode in a messy way. Create a workaround: Maybe I just ought to do both of those things by default.

Possibly explore DOS long filename drivers.