Arc Forumnew | comments | leaders | submitlogin
4 points by nex3 4553 days ago | link | parent

You probably want to look at the uname and date functions in arc.arc. If you can get these two to avoid using system (maybe by using the $ drop-to-Scheme operator) everything should work. Hopefully.

Edit: never mind, I just did this. All the date stuff is now platform-independent... does it work now?

2 points by eds 4553 days ago | link

Now I am getting:

  arc> (defop hello req (pr "hello world"))
  arc> (asv)
  The syntax of the command is incorrect.
  ready to serve port 8080
and upon going to http://localhost:8080/hello (which is still blank)

  open-output-file: cannot open output file: "C:\User\Programming\Arc\arc-wiki\arc
  /logs/srv-2008-02-26" (The system cannot find the path specified.; errno=3)
   === context ===
If I instead manually create a directory arc/logs before attempting (asv), everything works fine.

It looks like (asv) calls (serve port), which calls (ensure-dir logdir* ), which would seem to be our culprit

  arc> (ensure-dir logdir* )
  The syntax of the command is incorrect.
since ensure-dir calls directly out to mkdir and Windows breaks on the forward slashes in the command. Changing that part of the definition of ensure-dir from

  (system (string "mkdir -p " path))
to using the convenient definitions in files.arc

  (mkdir path)
should do the trick.

EDIT: Verified that the fix works with both (asv) and (nsv); pushed to Anarki. This should resolve web server problems on Windows.


2 points by nex3 4553 days ago | link

I was working on this, too, and I got rid of your commit and added mine (sorry!). There are some complications with just using make-directory - specifically, it doesn't create parents directories. We need make-directory* to do this, and that sets the sticky bit on directories in Unix. So my solution was to use system on Unix and make-directory*.


1 point by eds 4553 days ago | link

Whatever, just so long as it works :)