Advertisement
Guest User

loc

a guest
Mar 6th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.50 KB | None | 0 0
  1. #!/usr/bin/guile
  2. -e main -s
  3. !#
  4. (if (null? (cdr (program-arguments))) (quit))
  5. (define locfile (cadr (program-arguments)))
  6. (if (not (file-exists? locfile)) ((display "No such file.\n") (quit)))
  7. (define pwd (string-append (getcwd) "/" locfile))
  8. (define origpwd pwd)
  9. (define public_html (string-contains pwd "public_html"))
  10. (if public_html (set! pwd (string-drop pwd (+ 1 public_html (string-length "public_html")))))
  11. (set! pwd (string-append "http://" pwd))
  12. (display origpwd)(newline)
  13. (display pwd)(newline)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement