The cl-diskspace Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-diskspace Reference Manual

This is the cl-diskspace Reference Manual, version 0.3.1, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 07:59:46 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-diskspace

cl-diskspace is a Common Lisp feature to list disks with command line tool df(Linux/Mac) or GetLogicalDrives(Windows), and get disk space information using statvfs(Unix/Linux/Mac) or GetDiskFreeSpace(Windows), supports Unix/Linux/Mac/Windows.

License

Copyright (c) 2015 Muyinliu Xing Released under the ISC License.

Compatibility

| Common Lisp | Linux | Mac | Unix | Windows | |---------------|:-------:|:----:|:-----:|:-------:| | SBCL | Yes | Yes | | Yes |

Note: I don't have Unix system so haven't test on Unix yet.

Note: Have test in Windows XP/Windows 7/Windows 8.1/Windows 10

Note: Welcome to reply test results in other Common Lisp implements.

Install and load with QuickLisp

In shell:

git clone https://github.com/muyinliu/cl-diskspace.git
cp -r cl-diskspace ~/quicklisp/local-projects/

In Common Lisp:

(ql:quickload 'cl-diskspace)

Usage

List all disks

(diskspace:list-all-disks)

Will get something like this:

("/" "/Volumes/Seagate1T")

Note: result in Mac

(diskspace:list-all-disks)

Will get something like this:

("C:\\" "D:\\")

Note: result in Windows

Get all disk space information

(diskspace:list-all-disk-info)

Will get something like this:

((:DISK "/" :TOTAL 127175917568 :FREE 16509661184 :AVAILABLE
16247517184 :USE-PERCENT 87))

Get all disk space information in human-readable

(diskspace:list-all-disk-info t)

Will get something like this:

((:DISK "/" :TOTAL "118.44G" :FREE "15.38G" :AVAILABLE
"15.13G" :USE-PERCENT 87))

Get disk space information

(diskspace:disk-space "/")

Will get something like this:

127175917568
16509661184
16247517184

Note: the total space is 118.44G, free space is 15.38G and available space is 15.13G

Get disk space information in human-readable

(diskspace:disk-space "/" t)

Will get something like this:

"118.44G"
"15.38G"
"15.13G"

Get disk total space

(diskspace:disk-total-space "/")

Will get something like this:

127175917568

Get disk total space in human-readable

(diskspace:disk-total-space "/" t)

Will get something like this:

"118.4G"

Get disk free space

(diskspace:disk-free-space "/")

Will get something like this:

16509661184

Get disk free space in human-readable

(diskspace:disk-free-space "/" t)

Will get something like this:

"15.38G"

Get disk available space

(diskspace:disk-available-space "/")

Will get something like this:

16247517184

Get disk available space in human-readable

(diskspace:disk-available-space "/" t)

Will get something like this:

"15.13G"

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-diskspace

Author

Muyinliu Xing <muyinliu@gmail.com>

License

ISC

Description

List disks, get disk total/free/usable space information.

Version

0.3.1

Dependencies
Source

cl-diskspace.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 cl-diskspace/src

Parent

cl-diskspace (system)

Location

src/

Components

Previous: , Up: Modules   [Contents][Index]

3.2 cl-diskspace/src/unix

Dependency

utils.lisp (file)

Parent

src (module)

Location

src/unix/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 cl-diskspace.asd

Location

cl-diskspace.asd

Systems

cl-diskspace (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 cl-diskspace/src/packages.lisp

Parent

src (module)

Location

src/packages.lisp

Packages

cl-diskspace


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 cl-diskspace/src/utils.lisp

Dependency

packages.lisp (file)

Parent

src (module)

Location

src/utils.lisp

Exported Definitions

size-in-human-readable (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 cl-diskspace/src/unix/grovel-statvfs.lisp

Parent

unix (module)

Location

src/unix/grovel-statvfs.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df.lisp

Dependency

grovel-statvfs.lisp (file)

Parent

unix (module)

Location

src/unix/cl-diskspace-list-all-disks-with-df.lisp

Exported Definitions

list-all-disks (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 cl-diskspace/src/unix/cl-diskspace-statvfs.lisp

Dependency

cl-diskspace-list-all-disks-with-df.lisp (file)

Parent

unix (module)

Location

src/unix/cl-diskspace-statvfs.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.7 cl-diskspace/src/common.lisp

Dependency

unix (module)

Parent

src (module)

Location

src/common.lisp

Exported Definitions

list-all-disk-info (function)


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 cl-diskspace

Source

packages.lisp (file)

Nicknames
Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: disk-available-space PATH &optional HUMAN-READABLE-P

Disk available space.

Package

cl-diskspace

Source

cl-diskspace-statvfs.lisp (file)

Function: disk-free-space PATH &optional HUMAN-READABLE-P

Disk free space.

Package

cl-diskspace

Source

cl-diskspace-statvfs.lisp (file)

Function: disk-space PATH &optional HUMAN-READABLE-P

Disk space information include total/free/available space.

Package

cl-diskspace

Source

cl-diskspace-statvfs.lisp (file)

Function: disk-total-space PATH &optional HUMAN-READABLE-P

Disk total space.

Package

cl-diskspace

Source

cl-diskspace-statvfs.lisp (file)

Function: list-all-disk-info &optional HUMAN-READABLE-P

List disk information. example result:
((:DISK "/" :TOTAL 19993329664 :FREE 6154420224 :AVAILABLE 6154420224 :USE-PERCENT 69)
(:DISK "/mnt" :TOTAL 21136445440 :FREE 2048335872 :AVAILABLE 974667776 :USE-PERCENT 95))

((:DISK "/" :TOTAL "18.62 GB" :FREE "5.73 GB" :AVAILABLE "5.73 GB" :USE-PERCENT 69)
(:DISK "/mnt" :TOTAL "19.68 GB" :FREE "1.91 GB" :AVAILABLE "929.52 MB" :USE-PERCENT 95))

Package

cl-diskspace

Source

common.lisp (file)

Function: list-all-disks ()

List all physical disk use command line tool df. note: size in KB.

Package

cl-diskspace

Source

cl-diskspace-list-all-disks-with-df.lisp (file)

Function: size-in-human-readable NUMBER
Package

cl-diskspace

Source

utils.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Constants

Constant: size-of-fsblkcnt
Package

cl-diskspace

Source

/home/quickbuilder/.cache/common-lisp/sbcl-1.4.0-linux-x64/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-diskspace-20180131-git/src/unix/grovel-statvfs.processed-grovel-file

Constant: size-of-fsfilcnt
Package

cl-diskspace

Source

/home/quickbuilder/.cache/common-lisp/sbcl-1.4.0-linux-x64/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-diskspace-20180131-git/src/unix/grovel-statvfs.processed-grovel-file

Constant: size-of-statvfs
Package

cl-diskspace

Source

/home/quickbuilder/.cache/common-lisp/sbcl-1.4.0-linux-x64/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-diskspace-20180131-git/src/unix/grovel-statvfs.processed-grovel-file

Constant: st-nosuid
Package

cl-diskspace

Source

/home/quickbuilder/.cache/common-lisp/sbcl-1.4.0-linux-x64/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-diskspace-20180131-git/src/unix/grovel-statvfs.processed-grovel-file

Constant: st-rdonly
Package

cl-diskspace

Source

/home/quickbuilder/.cache/common-lisp/sbcl-1.4.0-linux-x64/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-diskspace-20180131-git/src/unix/grovel-statvfs.processed-grovel-file


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Functions

Function: %statvfs PATH BUF
Package

cl-diskspace

Source

cl-diskspace-statvfs.lisp (file)

Function: statvfs PATH
Package

cl-diskspace

Source

cl-diskspace-statvfs.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Classes

Class: statvfs-tclass ()
Package

cl-diskspace

Source

/home/quickbuilder/.cache/common-lisp/sbcl-1.4.0-linux-x64/home/quickbuilder/quicklisp/dists/quicklisp/software/cl-diskspace-20180131-git/src/unix/grovel-statvfs.processed-grovel-file

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
cl-diskspace.asd: The cl-diskspace<dot>asd file
cl-diskspace/src: The cl-diskspace/src module
cl-diskspace/src/common.lisp: The cl-diskspace/src/common<dot>lisp file
cl-diskspace/src/packages.lisp: The cl-diskspace/src/packages<dot>lisp file
cl-diskspace/src/unix: The cl-diskspace/src/unix module
cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df.lisp: The cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df<dot>lisp file
cl-diskspace/src/unix/cl-diskspace-statvfs.lisp: The cl-diskspace/src/unix/cl-diskspace-statvfs<dot>lisp file
cl-diskspace/src/unix/grovel-statvfs.lisp: The cl-diskspace/src/unix/grovel-statvfs<dot>lisp file
cl-diskspace/src/utils.lisp: The cl-diskspace/src/utils<dot>lisp file

F
File, Lisp, cl-diskspace.asd: The cl-diskspace<dot>asd file
File, Lisp, cl-diskspace/src/common.lisp: The cl-diskspace/src/common<dot>lisp file
File, Lisp, cl-diskspace/src/packages.lisp: The cl-diskspace/src/packages<dot>lisp file
File, Lisp, cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df.lisp: The cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df<dot>lisp file
File, Lisp, cl-diskspace/src/unix/cl-diskspace-statvfs.lisp: The cl-diskspace/src/unix/cl-diskspace-statvfs<dot>lisp file
File, Lisp, cl-diskspace/src/unix/grovel-statvfs.lisp: The cl-diskspace/src/unix/grovel-statvfs<dot>lisp file
File, Lisp, cl-diskspace/src/utils.lisp: The cl-diskspace/src/utils<dot>lisp file

L
Lisp File, cl-diskspace.asd: The cl-diskspace<dot>asd file
Lisp File, cl-diskspace/src/common.lisp: The cl-diskspace/src/common<dot>lisp file
Lisp File, cl-diskspace/src/packages.lisp: The cl-diskspace/src/packages<dot>lisp file
Lisp File, cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df.lisp: The cl-diskspace/src/unix/cl-diskspace-list-all-disks-with-df<dot>lisp file
Lisp File, cl-diskspace/src/unix/cl-diskspace-statvfs.lisp: The cl-diskspace/src/unix/cl-diskspace-statvfs<dot>lisp file
Lisp File, cl-diskspace/src/unix/grovel-statvfs.lisp: The cl-diskspace/src/unix/grovel-statvfs<dot>lisp file
Lisp File, cl-diskspace/src/utils.lisp: The cl-diskspace/src/utils<dot>lisp file

M
Module, cl-diskspace/src: The cl-diskspace/src module
Module, cl-diskspace/src/unix: The cl-diskspace/src/unix module

Jump to:   C   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %  
D   F   L   S  
Index Entry  Section

%
%statvfs: Internal functions

D
disk-available-space: Exported functions
disk-free-space: Exported functions
disk-space: Exported functions
disk-total-space: Exported functions

F
Function, %statvfs: Internal functions
Function, disk-available-space: Exported functions
Function, disk-free-space: Exported functions
Function, disk-space: Exported functions
Function, disk-total-space: Exported functions
Function, list-all-disk-info: Exported functions
Function, list-all-disks: Exported functions
Function, size-in-human-readable: Exported functions
Function, statvfs: Internal functions

L
list-all-disk-info: Exported functions
list-all-disks: Exported functions

S
size-in-human-readable: Exported functions
statvfs: Internal functions

Jump to:   %  
D   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   C   S  
Index Entry  Section

C
Constant, size-of-fsblkcnt: Internal constants
Constant, size-of-fsfilcnt: Internal constants
Constant, size-of-statvfs: Internal constants
Constant, st-nosuid: Internal constants
Constant, st-rdonly: Internal constants

S
size-of-fsblkcnt: Internal constants
size-of-fsfilcnt: Internal constants
size-of-statvfs: Internal constants
st-nosuid: Internal constants
st-rdonly: Internal constants

Jump to:   C   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-diskspace: The cl-diskspace system
cl-diskspace: The cl-diskspace package
Class, statvfs-tclass: Internal classes

P
Package, cl-diskspace: The cl-diskspace package

S
statvfs-tclass: Internal classes
System, cl-diskspace: The cl-diskspace system

Jump to:   C   P   S