Commit b9840c4e authored by Tom Niget's avatar Tom Niget

Add stat module

parent 6a257d04
//
// Created by Tom on 04/07/2023.
//
#ifndef TYPON_STAT_HPP
#define TYPON_STAT_HPP
#include "builtins.hpp"
#include <sys/stat.h>
#undef S_ISDIR
#undef S_ISREG
#undef S_ISLNK
namespace py_stat {
struct stat_t {
FUNCTION(bool, S_ISDIR, (int mode), { return (mode & S_IFMT) == S_IFDIR; })
FUNCTION(bool, S_ISREG, (int mode), { return (mode & S_IFMT) == S_IFREG; })
FUNCTION(bool, S_ISLNK, (int mode), { return (mode & S_IFMT) == S_IFLNK; })
} all;
auto &get_all() { return all; }
} // namespace py_stat
#endif // TYPON_STAT_HPP
# coding: utf-8
def S_IMODE(mode: int) -> int: ...
def S_IFMT(mode: int) -> int: ...
def S_ISBLK(mode: int) -> bool: ...
def S_ISCHR(mode: int) -> bool: ...
def S_ISDIR(mode: int) -> bool: ...
def S_ISDOOR(mode: int) -> bool: ...
def S_ISFIFO(mode: int) -> bool: ...
def S_ISLNK(mode: int) -> bool: ...
def S_ISPORT(mode: int) -> bool: ...
def S_ISREG(mode: int) -> bool: ...
def S_ISSOCK(mode: int) -> bool: ...
def S_ISWHT(mode: int) -> bool: ...
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment