File: FileSystem.ri

package info (click to toggle)
ruby-filesystem 0.5-5.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 124 kB
  • ctags: 102
  • sloc: ansic: 441; makefile: 86; ruby: 47
file content (22 lines) | stat: -rw-r--r-- 2,748 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Not automatically generated....
raise 'Must be invoked by installation process' unless $opfile

# -----------------------------------------
aClass = ClassModule.new("FileSystem", "", "module")
aClass.addFragment(Paragraph.new("The <code>FileSystem</code> module provides information about mounted file-systems.\n"))
aClass.addFragment(Verbatim.new("  require 'filesystem'\n  FileSystem.mounts.each {|m|\n    s = FileSystem.stat m.mount\n    puts \"\#\{m.mount} \#\{s.blocks_avail}\"\n  }\n"))

m0001 = MethodDesc.new("mounts", "class", "FileSystem.mounts( <i>optional_file_name</i>) -> <i>array</i>\nFileSystem.mounts( <i>optional_file_name</i> ) { |<i>mt<i>| <i>optional block</i> } ");
m0001.addFragment(Paragraph.new("Returns an array of FileSystemMount structures, describing the mounted filesystems.\n"))
m0001.addFragment(Paragraph.new("The default mount-table filename is <code>/etc/mtab</code> on Linux, and <code>/etc/mnttab</code> on Solaris.  On Linux, this method can scan <code>/etc/fstab</code> also.\n"))
m0001.addFragment(Paragraph.new("The members of the Mount structure are:  <code>device</code> - filesystem device name;  <code>mount</code> - mount point path;  <code>fstype</code> - filesystem type;  <code>options</code> - mount options;  <code>time</code> - time when the filesystem was mounted (Solaris);  <code>dump_interval</code> - days between dumps (Linux);  <code>check_pass</code> - pass number of filesystem check (Linux);"))
aClass.addMethod(m0001)

m0002 = MethodDesc.new("stat", "class", "FileSystem.stat(<i>path</i>) -> <i>array</i>");
m0002.addFragment(Paragraph.new("Returns a FileSystemStat structure describing the filesystem containing the given file path.\n"))
m0002.addFragment(Paragraph.new("The members of the Stat structure are: <code>path</code> - directory path provided; <code>block_size</code> - optimal transfer block size;  <code>blocks</code> - total number of data blocks in file system;  <code>blocks_free</code> - number of free blocks in file system;  <code>blocks_avail</code> - number of free blocks available to non-super-user;  <code>files</code> - total number of file nodes in file system;  <code>files_free</code> - number of free file nodes in file system;  <code>files_avail</code> - number of free file nodes available to non-super-user;  <code>flags</code> - file system flags;  <code>maxnamelen</code> - maximum file name length"))
m0002.addFragment(Paragraph.new("The module defines the following constants for the Stat.flags member:\n  RDONLY, NOSUID, NOTRUNC, NODEV,  NOEXE, SYNC, MANDLOCK, WRITE, APPEND, IMMUTABLE, NOATIME, NODIRATIME.\n  Not all constants are available on all platforms."))
aClass.addMethod(m0002)

File.open($opfile, "w") {|f| Marshal.dump(aClass, f) }