forked from djberg96/sys-filesystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
80 lines (60 loc) · 2.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
= Description
A Ruby interface for getting file system information.
= Installation
gem install sys-filesystem
= Synopsis
require 'sys/filesystem'
include Sys
# Display information about a particular filesystem.
p Filesystem.stat('/')
# Sample output
#<Sys::Filesystem::Stat:0x517440
@base_type = "ufs",
@flags = 4,
@files_available = 3817457,
@block_size = 8192,
@blocks_available = 19957633,
@blocks = 34349612,
@name_max = 255,
@path = "/",
@filesystem_id = 35651592,
@files = 4135040,
@fragment_size = 1024,
@files_free = 3817457,
@blocks_free = 20301129
>
# Describe all mount points on the system
Filesystem.mounts{ |mount| p mount }
# Find the mount point of any particular file
puts Filesystem.mount_point('/home/djberge/some_file.txt') => '/home'
= Notes
This is a pure Ruby implementation that uses FFI. This means it should work
with JRuby, too.
= Sample code
Run 'rake example' if you want to see a basic sample run. The actual code
is 'example_stat.rb' in the 'examples' directory. Modify it as you see fit.
= Known Bugs
None that I'm aware of. Please report bugs on the project page at
https://github.com/djberg96/sys-filesystem
= Future Plans
Add better 64-bit support for Linux and BSD.
Other suggestions welcome.
= Acknowledgements
Mike Hall, for ideas and code that I borrowed from his 'filesystem' library.
Park Heesob, for implementation and API ideas for the MS Windows version.
Nobuyoshi Miyokawa, for adding the original FreeBSD and OS X support.
= License
Artistic 2.0
== Contributions
Although this library is free, please consider having your company
setup a gittip if used by your company professionally.
http://www.gittip.com/djberg96/
= Copyright
(C) 2003-2016 Daniel J. Berger
All Rights Reserved
= Warranty
This library is provided "as is" and without any express or
implied warranties, including, without limitation, the implied
warranties of merchantability and fitness for a particular purpose.
= Author
Daniel J. Berger