Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created March 16, 2015 15:53
Show Gist options
  • Save jaytaph/14072c93a0509ce72f2e to your computer and use it in GitHub Desktop.
Save jaytaph/14072c93a0509ce72f2e to your computer and use it in GitHub Desktop.
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