Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added IO::Stat, and a .stat method for IO
Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
- Loading branch information
Showing
3 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
class IO::Stat { | ||
has $.path; | ||
|
||
method exists { | ||
?pir::stat__isi($.path, 0); | ||
} | ||
|
||
method size { | ||
pir::stat__isi($.path, 1); | ||
} | ||
|
||
method isdir { | ||
?pir::stat__isi($.path, 2); | ||
} | ||
|
||
method isdev { | ||
?pir::stat__isi($.path, 3); | ||
} | ||
|
||
method createtime { | ||
pir::stat__isi($.path, 4); | ||
} | ||
|
||
method accesstime { | ||
pir::stat__isi($.path, 5); | ||
} | ||
|
||
method modifytime { | ||
pir::stat__isi($.path, 6); | ||
} | ||
|
||
method changetime { | ||
pir::stat__isi($.path, 7); | ||
} | ||
|
||
method backuptime { | ||
pir::stat__isi($.path, 8); | ||
} | ||
|
||
method uid { | ||
pir::stat__isi($.path, 9); | ||
} | ||
|
||
method gid { | ||
pir::stat__isi($.path, 10); | ||
} | ||
} | ||
|
||
# vim: ft=perl6 |