Closed BookOwl closed 8 years ago
fwrite
, fappend
, fread
, freadlines
, freadbytes
?
We don't have a way to work with bytes with Stack.
For opening files, how about 'file1.txt' fopen
'file1.txt' fopen fread
?
Yes
What type of data is the result of 'file1.txt' fopen
?
A file type that supports the file operations.
Okay :package:
I'll implement it.
kthx.
:P Though if you take a look at my stdlib branch you can see I've already got importing python modules working!
You should check it out.
Awesome!
Wow importing Python modules!
Also can you do 1 fread
to read from STDIN?
Why 1
?
In theory you could do so, but you'd need to write a python script to get sys.stdin
's path. :package:
Also like a lot of things here #23
Implemented by #23
Why
1
?
Because 1
is the file descriptor for STDIN.
(it may need casting or something though as it isn't a complete file object)
If not, you can still do '/dev/tty' fopen
on UNIX-like systems. (but not windows)
Oh yes, that's true.
Oh yes, that's true.
oh wait you can already do that with '' input
but you could use fwrite
to write to stderr
We need to figure out what the interface for accessing files from Stack scripts should be.