• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..10-Feb-2022-

mrblib/H10-Feb-2022-5951

src/H10-Feb-2022-874754

test/H10-Feb-2022-409340

.gitignoreH A D10-Feb-202249 65

.travis.ymlH A D10-Feb-2022336 1615

.travis_build_config.rbH A D10-Feb-2022124 86

README.mdH A D10-Feb-20222 KiB8368

appveyor.ymlH A D10-Feb-2022473 2018

config.h.inH A D10-Feb-2022631 2013

configureH A D10-Feb-2022122.6 KiB4,3213,549

configure.acH A D10-Feb-2022473 2114

mrbgem.rakeH A D10-Feb-2022960 3329

README.md

1# mruby-file-stat
2
3[![Build Status](https://travis-ci.org/ksss/mruby-file-stat.svg?branch=master)](https://travis-ci.org/ksss/mruby-file-stat)
4[![Build status](https://ci.appveyor.com/api/projects/status/04am84uda2cj49n3/branch/master?svg=true)](https://ci.appveyor.com/project/ksss/mruby-file-stat/branch/master)
5
6**File::Stat** class in mruby
7
8```ruby
9stat = File::Stat.new('filename') # or File.stat('filename')
10stat.dev #=> device id
11stat.dev_major #=> device major id
12stat.dev_minor #=> device minor id
13stat.ino #=> i-node number
14stat.mode #=> permission value (st_mode)
15stat.nlink #=> hard link count
16stat.uid #=> user id
17stat.gid #=> group id
18stat.rdev #=> device type
19stat.rdev_major #=> rdev major id
20stat.rdev_minor #=> rdev minor id
21stat.atime #=> last access time
22stat.mtime #=> last modify time
23stat.ctime #=> last change attribute time
24stat.birthtime #=> file created time
25stat.size #=> file size(byte)
26stat.blksize #=> file I/O block size
27stat.blocks #=> attached block num
28stat.grpowned #=> same gid?
29stat.<=> #=> comparate mtime (-1,0,1 or nil)
30stat.size?
31stat.zero?
32stat.symlink?
33stat.file?
34stat.directory?
35stat.chardev?
36stat.blockdev?
37stat.pipe?
38stat.socket?
39stat.owned?
40stat.owned_real?
41stat.readable?
42stat.readable_real?
43stat.writable?
44stat.writable_real?
45stat.executable?
46stat.executable_real?
47stat.world_readable?
48stat.world_writable?
49stat.setuid?
50stat.setgid?
51stat.sticky?
52stat.ftype #=> socket, link, file, blockSpecial, directory, characterSpecial, fifo or unknown
53```
54
55This library is wrap of struct stat.
56
57## Installation
58
59### use github repository
60
61Write in /mruby/build_config.rb
62
63```ruby
64MRuby::Build.new do |conf|
65  # by mgem
66  conf.gem :mgem => 'mruby-file-stat'
67  # by github
68  conf.gem :github => 'ksss/mruby-file-stat', :branch => 'master'
69end
70```
71
72## Homepage
73
74https://github.com/ksss/mruby-file-stat
75
76## License
77
78See [https://github.com/ruby/ruby/blob/trunk/file.c](https://github.com/ruby/ruby/blob/trunk/file.c)
79
80## Doc
81
82[http://ruby-doc.org/core-2.1.5/File/Stat.html](http://ruby-doc.org/core-2.1.5/File/Stat.html)
83