Arc Forumnew | comments | leaders | submitlogin
6 points by kens 5644 days ago | link | parent

Currently, ensure-dir and date use system to run Unix commands. It would be much more portable if they used mzscheme operations instead. This has caused me trouble not only on Windows, but different versions of Linux. And I think make-temporary-file could replace /dev/urandom.


3 points by pg 5642 days ago | link

I changed date to get the date from Mzscheme, but it's not so easy to change ensure-dir. Mz's make-directory doesn't create intermediate directories like mkdir -p, and I don't want to get into trying to understand pathnames.

-----

2 points by thaddeus 5642 days ago | link

------------------------ In ac.scm

    1. added:
    (require (lib "file.ss"))


    2. added:
    (xdef 'make-directory make-directory)
    (xdef 'make-directory* make-directory*)
------------------------ In arc.arc (got from anarki)

    (def mkdir (path (o parents))
         (if (is parents nil)
             (make-directory path)
             (make-directory* path))
    )

    (def ensure-dir (path)
        (unless (dir-exists path)
             (mkdir path t)))
       
I tested on Windows... (ensure-dir "C:/thaddeus/arc/thaddeus/thaddeus/")

Edited. T.

-----

1 point by eds 5642 days ago | link

Here are the two patches for ensure-dir in Anarki stable:

http://github.com/nex3/arc/commit/111fa3c8f021c4abffc1526c88...

http://github.com/nex3/arc/commit/e4ba31f34f84cd946403541ca8...

According to the comment, there is a bug in MzScheme <371 which sets the sticky bit on *nix, so it may still be necessary to call system sometimes.

-----

1 point by thaddeus 5642 days ago | link

don't forget these changes require mods for the $ usage (which you can probably cut out)

and (xdef 'which-os system-type).

T.

-----

1 point by CatDancer 5642 days ago | link

Oh right, now I remember the sticky bit problem! http://arclanguage.org/item?id=2716

. . . .

-----

1 point by CatDancer 5642 days ago | link

If someone wants to implement this, make-directory* in the file.ss library (http://download.plt-scheme.org/doc/352/html/mzlib/mzlib-Z-H-...) looks like it might do it for you. But I haven't tried it myself (I'm not running Windows either).

-----

2 points by CatDancer 5644 days ago | link

If anyone wants to take on being a distributor for a Windows port (or for different variants of Linux, for that matter), I do have a patch for date here: http://catdancer.github.com/date.html

-----

2 points by eds 5643 days ago | link

Another option is the Anarki stable branch (http://github.com/nex3/arc/commits/stable/), which has most of fixes necessary to make most of Arc work portably on Windows and other OSes. (And, being a bug-fix branch, the amount of other random material is limited.)

-----

4 points by thaddeus 5643 days ago | link

I agree with the option, but I also think these posts will fall off the deep end in about 2 months. By then new members may only discover the option after they've discovered the problem. So we're not really saving new members wasted efforts unless the install page guides people.

T.

-----

2 points by pmarin 5643 days ago | link

Why not to setup some kind of wiki under arcelanguage.org? The Tclers Wiki is a great example. http://wiki.tcl.tk/

-----

1 point by eds 5643 days ago | link

pg: Even if you'd rather not think about supporting Windows portability yourself, providing a link to the Anarki stable branch would help new Windows users. Finding this stuff on the forum after it's fallen off the top couple of pages is not very easy.

-----