Multi- and Cross-Platform Compatibility with DrawFBP

18 views
Skip to first unread message

Dale Hurtt

unread,
May 11, 2012, 1:10:57 PM5/11/12
to Flow Based Programming
Does anyone know a way of using DrawFBP drawings on more than
computer? I created a drawing on my PC, which included subdiagrams,
and when I sent it to my Mac, it could not open it (in fact the
application hung). When I looked through the drawing (.drw file) I saw
that the reference to the subdiagram drawing included the absolute
path to the file, which of course will not work on the Mac, nor likely
to work on another PC that does not use the exact same path.

I edited the file manually, indicating just the filename, removing all
path references, and it still hung. Is there some switch or
configuration setting to tell DrawFBP to use relative paths instead of
absolute paths?

I am using the .jnlp version of the application, if it matters any.

Thanks in advance,

Dale

Paul Morrison

unread,
May 11, 2012, 1:25:00 PM5/11/12
to flow-based-...@googlegroups.com
I believe Bob Corrick has run DrawFBP on Linux - am I right, Bob? If
so, do you remember what we had to do?

Either way, Dale, I would be happy to collaborate with you - it is great
to have users using other platforms than what I have available to me!

Regards,

Paul M.
--
http://jpaulmorrison.blogspot.com/

Dale Hurtt

unread,
May 11, 2012, 3:34:10 PM5/11/12
to Flow Based Programming
That sounds great Paul, but I think the problem is straightforward.
When running under Windows it is saving the reference to the drawing
using an absolute path. That simply doesn't translate to any other
platform. Even another Windows workstation would find the file
unusable unless it had the files in the exact same path. Several
solutions present itself:

1. Store the relative reference of the drawing. This could still be a
problem unless the code can switch the path based on the platform
using the file (e.g. Unix and Mac would use "../lib/mydrawing.drw"
whereas Windows would use "..\lib\mydrawing.drw"). Should be
relatively easy to switch based upon the platform running.

2. Always store just the drawing name (e.g. "mydrawing.drw") and if
the drawing is not in the same directory and the current drawing,
prompt for its location.

Just some thoughts. Hopefully this has already been addressed and it
is a simple matter of running the application with a switch.

Thanks,

Dale

P.S. Still plowing through your book and trying to use the principles
with NoFlo. I am hating CoffeeScript at the moment though...

John Cowan

unread,
May 11, 2012, 4:46:11 PM5/11/12
to flow-based-...@googlegroups.com
Dale Hurtt scripsit:

> 1. Store the relative reference of the drawing. This could still be a
> problem unless the code can switch the path based on the platform
> using the file (e.g. Unix and Mac would use "../lib/mydrawing.drw"
> whereas Windows would use "..\lib\mydrawing.drw"). Should be
> relatively easy to switch based upon the platform running.

It suffices to store it with forward slashes always, because the Win32
APIs (though not the command line or the File Open/Save dialogs) treat
/ and \ equivalently: "../lib/mydrawing.drw" will work on Windows.

> 2. Always store just the drawing name (e.g. "mydrawing.drw") and if
> the drawing is not in the same directory and the current drawing,
> prompt for its location.

That also works.

--
John Cowan co...@ccil.org http://ccil.org/~cowan
I am he that buries his friends alive and drowns them and draws them
alive again from the water. I came from the end of a bag, but no bag
went over me. I am the friend of bears and the guest of eagles. I am
Ringwinner and Luckwearer; and I am Barrel-rider. --Bilbo to Smaug

Paul Morrison

unread,
May 12, 2012, 10:13:05 PM5/12/12
to flow-based-...@googlegroups.com
A lot of good suggestions - I'm working on it! Can one assume that the
directory structure is the same on both machines? Or is it reasonable
to assume that all subdiagrams are in the same directory as the main
diagram (on both machines)? TIA

Paul


On 11/05/2012 1:10 PM, Dale Hurtt wrote:
--
http://jpaulmorrison.blogspot.com/

Dale Hurtt

unread,
May 13, 2012, 2:34:08 PM5/13/12
to Flow Based Programming
No, I don't think you should assume the same directory structure, even
if on the same OS. Rather, imagine that a user tars/zips up the
directory where all of his files are located, sends the archive, and
the next person/platform simply untars/unzips it and it all works. So,
if not in the same directory, references should be relative (e.g. ../
components/ReadFile.drw). Failing that, having all drawings in the
same subdirectory is the next best solution.

Thanks!

Henri Bergius

unread,
May 14, 2012, 4:52:58 AM5/14/12
to flow-based-...@googlegroups.com
On Sun, May 13, 2012 at 8:34 PM, Dale Hurtt <dale...@gmail.com> wrote:
> No, I don't think you should assume the same directory structure, even
> if on the same OS. Rather, imagine that a user tars/zips up the
> directory where all of his files are located, sends the archive, and
> the next person/platform simply untars/unzips it and it all works. So,
> if not in the same directory, references should be relative (e.g. ../
> components/ReadFile.drw). Failing that, having all drawings in the
> same subdirectory is the next best solution.

This is sort of how component loading works in NoFlo. Component names
given without a path are expected to reside somewhere under NoFlo's
"component root", and if you have some custom components in your graph
you should give a full path to them.

--
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Jabber: henri....@gmail.com
Microblogs: @bergie
Reply all
Reply to author
Forward
0 new messages