Topic: A couple of Linux WINE scripts (1 of 9), Read 37 times
Conf: Other, General, etc.
From: Doc Evans
Date: Thursday, May 04, 2006 11:55 AM

While waiting for a real Linux version, I figured it was
worth getting VPW to work in a reasonably friendly manner
on my x86_64 Mandriva 2006 system, now that WINE is getting
to the point of being actually useful (and also since I'm
finally trying to move completely away from Windows, and
VPW is one of the few programs that I cannot replace).

VPW installed fine under WINE. Once installed, I wrote two
simple scripts: one to allow files to be dropped from
Konqueror on to a VPW icon; and one for use inside a
console to allow one to use VPW in the usual "VPW
" manner.

Script #1:

-----

#! /bin/sh

# convert backslashes to forward slashes
f1=$1
f2="z:/"$f1

f3=`echo $f2 | sed -e 's/\/\//\//g' | sed -e
's/\//\\\\/g'`

wine "C:\\vedit\\vpw.exe" "$f3"

-----

Script #2:

-----

#! /bin/sh

# find absolute filename

# relative paths do not start with a "/
f1=$1

# first character
c=${f1:0:1}

if [ $c != "/" ]; then
f2=$PWD/$f1
else
f2=$f1
fi

# convert backslashes to forward slashes

f3="z:/"$f2

f4=`echo $f3 | sed -e 's/\/\//\//g' | sed -e
's/\//\\\\/g'`

wine "C:\\vedit\\vpw.exe" "$f4"

-----

I said they were simple :-)

Doc Evans

 


Topic: Re: A couple of Linux WINE scripts (2 of 9), Read 39 times
Conf: Other, General, etc.
From: Christian Ziemski
Date: Thursday, May 04, 2006 04:43 PM

On 04.05.2006 17:56 vtech-other Doc Evans wrote:

> VPW installed fine under WINE.

Oh, nice. Then I'll try to do that these days also.


> Once installed, I wrote two
> simple scripts: one to allow files to be dropped from
> Konqueror on to a VPW icon; and one for use inside a
> console to allow one to use VPW in the usual "VPW
> " manner.


You can reduce the sed calls from:

f3=`echo $f2 | sed -e 's/\/\//\//g' | sed -e
's/\//\\\\/g'`

to the a bit easier readable:

f3=`echo $f2 | sed -r -e 's=//?=\\\\=g'`


BTW: You wrote:

> # convert backslashes to forward slashes

but you meant it vice versa, right?!



Christian

 


Topic: Re: A couple of Linux WINE scripts (4 of 9), Read 38 times
Conf: Other, General, etc.
From: Doc Evans
Date: Thursday, May 04, 2006 07:32 PM

On 5/4/2006 4:43:31 PM, Christian Ziemski wrote:
>
>to the a bit easier readable:
>
>f3=`echo $f2 | sed -r -e 's=//?=\\\\=g'`
>

Readability is in the eye of the beholder :-) I don't enough sed to know how your version works, but I know how mine does :-)

>
>BTW: You wrote:
>
>> # convert backslashes to forward slashes
>
>but you meant it vice versa, right?!

Yep.

Doc

 


Topic: Re: A couple of Linux WINE scripts (6 of 9), Read 39 times
Conf: Other, General, etc.
From: Christian Ziemski
Date: Friday, May 05, 2006 03:46 AM

On Thu, 04 May 2006 19:32:00 -0400, Doc Evans wrote:

>On 5/4/2006 4:43:31 PM, Christian Ziemski wrote:
>>
>>to the a bit easier readable:
>>
>>f3=`echo $f2 | sed -r -e 's=//?=\\\\=g'`
>>
>
>Readability is in the eye of the beholder :-)

Absolutely! ;-)

>I don't enough sed to know how
>your version works, but I know how mine does :-)

In case you would like to know:

"sed -r" enables the full regular expressions (Fedora Linux here),
so that the following features work:

You can use another character than "/" as delimiter,
I used "=" to be able to have the "/" in the search string without
escaping.

"//?" searches for a slash and an additional (0 or 1) slash,
(so in fact for one or two slashes).


Christian

 


Topic: Re: A couple of Linux WINE scripts (3 of 9), Read 38 times
Conf: Other, General, etc.
From: Ted Green
Date: Thursday, May 04, 2006 05:12 PM

At 11:56 AM 5/4/2006, you wrote:
>VPW installed fine under WINE.

Cool.

># convert backslashes to forward slashes

Keep in mind that macros can be written with forward slashes;
under Windows they are internally converted to backslashes
before calling the Windows APIs.

Ted.

 


Topic: Re: A couple of Linux WINE scripts (5 of 9), Read 38 times
Conf: Other, General, etc.
From: Doc Evans
Date: Thursday, May 04, 2006 07:34 PM

On 5/4/2006 5:12:43 PM, Ted Green wrote:
>At 11:56 AM 5/4/2006, you
>wrote:
>>VPW installed fine under WINE.
>
>Cool.
>

It's sort-of installed in the past, but now it seems to install flawlessly.

>># convert backslashes to forward slashes
>
>Keep in mind that macros can
>be written with forward
>slashes;
>under Windows they are
>internally converted to
>backslashes
>before calling the Windows
>APIs.

I don't understand this comment.

All the script is doing is formatting filenames (and virtual drive letters) so that VPW and WINE do the right things with the unix-style filename. So perhaps it doesn't matter that I don't understand the comment.

Doc

 


Topic: Re: A couple of Linux WINE scripts (7 of 9), Read 41 times
Conf: Other, General, etc.
From: Christian Ziemski
Date: Friday, May 05, 2006 03:58 AM

On Thu, 04 May 2006 19:34:00 -0400, Doc Evans wrote:

>On 5/4/2006 5:12:43 PM, Ted Green wrote:
>>
>>Keep in mind that macros can be written with forward slashes;
>>under Windows they are internally converted to
>>backslashes before calling the Windows APIs.
>
>I don't understand this comment.

Even under Windows VEDIT is able to "understand" slashes.

Example: vpw.exe c:/vedit/startup.vdm

So it is (often/always?) not necessary to convert slashes to
backslashes before using them in filenames/pathes used by VEDIT.


Christian

 


Topic: Re: A couple of Linux WINE scripts (8 of 9), Read 41 times
Conf: Other, General, etc.
From: Doc Evans
Date: Tuesday, May 09, 2006 08:37 PM

On 5/5/2006 3:58:23 AM, Christian Ziemski wrote:
>
>Even under Windows VEDIT is able to
>"understand" slashes.
>
>Example: vpw.exe c:/vedit/startup.vdm
>
>So it is (often/always?) not necessary
>to convert slashes to
>backslashes before using them in
>filenames/pathes used by VEDIT.

Once VPW is running under WINE, it doesn't seem at all happy to see forward slashes and other Linux-isms in filenames. For example, if you try to Open /home/n7dr/fred it complains that a file cannot contain any of the characters /:<>|.

One can use the File Open dialog box OK, at least for files that have a mount point on the local file system, so it's not a major problem.

The only thing I have missed so far is due to the fact that VPW is not KDE-aware, so it can't use the kioslave protocols.

 


Topic: Re: A couple of Linux WINE scripts (9 of 9), Read 46 times
Conf: Other, General, etc.
From: Ted Green
Date: Tuesday, May 09, 2006 08:53 PM

At 04:38 PM 5/9/2006, you wrote:
>Once VPW is running under WINE, it doesn't seem at all happy to see forward slashes and other Linux-isms in filenames. For example, if you try to Open /home/n7dr/fred it complains that a file cannot contain any of the characters /:<>|.

How are you opening the file?
You probably are using the File->Open dialog box which does not support forward slashes. No Windows functions support forward slashes.
Only the VEDIT macro language support forward slashes.

I would expect {FILE, Open more, Quick open} to support forward slashes.

Whoever implemented DOS 2.0 with backslashes should be shot into high orbit and then into the sun.

Ted.