On Tue, 30 Sep 2003, Bart Oldeman wrote:

> On Tue, 30 Sep 2003, Ralph Alvy wrote:
>
> > Ralph Alvy wrote:
> > > Here's what I get after unpacking and running the 1.1.99.1 binary:
> > >
> > > ---
> > >
> > > [EMAIL PROTECTED] dosemu]$ ./xdosemu
> > > ./xdosemu: line 1: readlink: command not found
> > > ./xdosemu: line 285: cd: /../Xfonts: No such file or directory
> > >
> > >    You do not have the DOSEMU vga font installed and are running
> > >    remote X. You need to install the vga font on your _local_ Xserver.
> > >    Look at the readme for details. For now we start with an fixed font,
> > >    which does not display all national characters correctly.
> > >    ... be warned
> > >
> > > ./xdosemu: line 375: /../bin/dosemu.bin: No such file or directory
> > > ./xdosemu: line 375: exec: /../bin/dosemu.bin: cannot execute: No such
> > > file or directory
> >
> > Shouldn't the script execute
> >
> >         cd ./Xfonts
> >
> > instead of
> >
> >         cd /../Xfonts
> >
> > And the same for
> >
> >         cd /../bin
>
> no, the problem is that you don't have "readlink". But fortunately we can
> read a link using "ls" and, that combined with "sed" gives us a the poor
> man's readlink:
>
> BOOT_DIR_PATH=`ls -l $HOME/.dosemu/drives/c | sed 's/.* \([^ ]*\)$/\1/'`/..
> (line 245 of the script).
> Please try this instead of my previous workaround.

Hi,
this doesn't look like it will work if there is a space somewhere in
the path.  If awk is available on every system, then how about this:

BOOT_DIR_PATH=`ls -l $HOME/.dosemu/drives/c | awk -F"-> " '{ print $2 }'`/..

It uses "-> " as the field separator instead of the space.  On my system,
the last '/' isn't required (the contents of the link already have a
trailing slash), but I guess it doesn't hurt to leave it there.

Another option would be for dosemu to roll its own version of readlink
based on readlink(2).  Something like:

#include <unistd.h>
#include <stdio.h>

int main(int argc, char** argv)
{
  char buf[BUFSIZ];

  if ((argc == 2) && (readlink(argv[1], buf, BUFSIZ) != -1))
    printf("%s\n", buf);

  return 0;
}

Cheers,
Rob Komar
-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to