Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 31b91c5d37
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (20 sloc) 0.714 kb
#lang racket/base
(require racket/string
racket/runtime-path
racket/list)
(provide backup-file
replace-file
combined-command-line)
(define (backup-file file)
(when (or (file-exists? file) (link-exists? file))
(define-values (base name _) (split-path file))
(define backup-path (build-path base (string-append (path->string name) "~")))
(rename-file-or-directory file backup-path)))
(define (replace-file old new #:permissions [p #f])
(when (file-exists? old)
(delete-file old))
(copy-file new old)
(when p
(file-or-directory-permissions old p)))
(define (combined-command-line)
(string-join (vector->list (current-command-line-arguments)) " "))
Jump to Line
Something went wrong with that request. Please try again.