Created
March 16, 2015 15:53
-
-
Save jaytaph/14072c93a0509ce72f2e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import io; | |
import file; | |
f = file.open("test.txt", "r"); | |
io.print("FILE 1: ", f.path(), " => ", f.fileNo(), "\n"); | |
f2 = file.open("test.txt", "r"); | |
io.print("FILE 2: ", f2.path(), " => ", f2.fileNo(), "\n"); | |
io.dump(f.stat()); | |
f2.close(); | |
f.close(); | |
/* | |
FILE 1: test.txt => 3 | |
FILE 2: test.txt => 4 | |
Dump: | |
Key: st_mode Val: 33188 | |
Key: st_ino Val: 337728 | |
Key: st_dev Val: 2065 | |
Key: st_uid Val: 1000 | |
Key: st_gid Val: 1000 | |
Key: st_atime Val: 1426514536 | |
Key: st_ctime Val: 1426514473 | |
Key: st_mtime Val: 1426514473 | |
Key: st_nlink Val: 1 | |
Key: st_size Val: 14 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment