GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lpython/src/runtime/os.py at main · lcompilers/lpython

Expand file tree

/

os.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
44 lines (36 loc) · 845 Bytes
/

os.py

Copy path

File metadata and controls

44 lines (36 loc) · 845 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
from lpython import i32, i64, ccall
O_RDONLY: i32 # = 0 FIXME: Assign the value 0 to O_RDONLY
# O_WRONLY: i32 = 1
# O_RDWR : i32 = 2
# O_CREAT : i32 = 64
# O_APPEND: i32 = 1024
def open(path: str, flag: i32) -> i64:
"""
Returns the file descriptor for the newly opened file
"""
sflag: str
if flag == O_RDONLY:
sflag = "r"
else:
quit(1) # not implemented yet
return _lpython_open(path, sflag)
@ccall
def _lpython_open(path: str, flag: str) -> i64:
pass
def read(fd: i64, n: i64) -> str:
"""
Reads at most `n` bytes from file descriptor
"""
return _lpython_read(fd, n)
@ccall
def _lpython_read(fd: i64, n: i64) -> str:
pass
def close(fd: i64):
"""
Closes the file descriptor
"""
_lpython_close(fd)
return
@ccall
def _lpython_close(fd: i64):
pass
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.