On this page:
_ fs-txn
_ fs-txn/ null
fs-txn?
fs-begin-txn
fs-open-txn
fs-commit-txn
fs-abort-txn
fs-purge-txn
fs-txn-name
fs-txn-base-rev
fs-txn-prop
set-fs-txn-prop!
fs-list-txn-props
fs-list-txns
call-with-fs-txn
Version: 4.2.1

4.5 Transactions

_fs-txn : ctype?
_fs-txn/null : ctype?
C pointer type representing transaction objects.

(fs-txn? obj)  any
  obj : any/c
Checks whether the given obj is a transaction object.

(fs-begin-txn fs rev)  fs-txn?
  fs : fs?
  rev : exact-nonnegative-integer?
Creates a new transaction in fs, based on revision rev.

(fs-open-txn fs txn-name)  fs-txn?
  fs : fs?
  txn-name : bytes?
Opens an existing transaction in fs with the given binary txn-name.

(fs-commit-txn txn)  exact-nonnegative-integer?
  txn : fs-txn?
Commits the transaction txn. Returns the new revision number representing the committed data.

(fs-abort-txn txn)  void?
  txn : fs-txn?
Aborts the transaction txn.

(fs-purge-txn fs txn-name)  void?
  fs : fs?
  txn-name : bytes?
Purges the inactive transaction with the binary name txn-name from fs.

(fs-txn-name txn)  bytes?
  txn : fs-txn?
Retrieves the binary name of the given transaction.

(fs-txn-base-rev txn)  exact-nonnegative-integer?
  txn : fs-txn?
Retrieves the base revision number of the given transaction.

(fs-txn-prop txn prop-name)  (or/c bytes? #f)
  txn : fs-txn?
  prop-name : symbol?
(set-fs-txn-prop! txn prop-name value)  void?
  txn : fs-txn?
  prop-name : symbol?
  value : (or/c bytes? #f)
(set! (fs-txn-prop txn prop-name) value)
Retrieves or sets a transaction property as a binary string.

A non-existent property is represented by the value #f. When a property is set to #f, it is deleted.

(fs-list-txn-props txn)  (listof symbol?)
  txn : fs-txn?
Retrieves a list of all properties set on a transaction.

(fs-list-txns fs)  (listof fs-txn?)
  fs : fs?
Lists the binary names of all active transactions in the file system fs.

(call-with-fs-txn fs rev proc)  any
  fs : fs?
  rev : exact-nonnegative-integer?
  proc : (-> txn? any)
Creates a new transaction in the file system fs with base revision rev. Applies proc to the new transaction and commits the transaction.

If the dynamic context of the call-with-fs-txn expression is left after the transaction has been started but before it has been committed, the transaction is aborted.

Returns the new revision number containing the data committed in the transaction and all values (except the first one if it satisfies void?) returned by proc.