1. Re: DOS/Win and Linux path separator WAS: OOP Preprocessor "eo4"

Yep this caught me out the first time I tried to run one of my DOS/Win
Euphoria programs on Linux.  The problem was that DOS/Win uses '\' to
separate components of a directory path and Linux (well UNIX in general)
uses '/'.  I got round it by defining a global called "pathsep" to contain
the path separator.  At the start of the program I call platform() and
assign the appropriate path separator character to "pathsep".  Then all path
manipulation code needed to be amended to take out hard coded references to
'\' and use pathsep instead.

Fortunately the program wasn't very big so the work was really rather
trivial.  My solution seemed workable for the situation at hand but I can
see it wouldn't scale very well for existing large programs.

Of course path separators aren't the only fly in the ointment when it comes
to DOS/Win versus Linux (UNIX).  The DOS/Win file system is case-insenitive
when searching for file names - Linux is case sensitive for all file
operations.  DOS/Win has drive letters and "share" notation
(\\computername\sharename).  DOS only allows one dot in the name - Win and
Linux allow any number.  DOS does not allow a space in a file name - Win and
Linux does.  Personal peeve: I hate spaces in file names - what a kludge -
use an underscore!

Do any conventions or best practices exist for dealing with the above
problems?

Regards,

Andy Cranston.

-----Original Message-----
From: Kenneth Rhodes [mailto:hermanhesse at EXCITE.COM]
Sent: 18 September 2000 05:08
To: EUPHORIA at LISTSERV.MUOHIO.EDU
Subject: OOP Preprocessor "eo4" not generic


The OOP system recently posted on the RDS web site looks very
interesting.... but, it is not generic.

Under Linux exu does not execute *.exw files.  Renaming the files doesn't
work either because their are references to DOS "\" file path conventions.

Might be easy to fix though...


Ken Rhodes






_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu