Commit Graph

3 Commits

Author SHA1 Message Date
Bob Nystrom
1973934fa2 feat: add Stat.isFile, Stat.isDirectory, File.exists, and Directory.exists methods
Add four new file system checking functions: Stat.isFile and Stat.isDirectory for querying entry type from a Stat object, and File.exists and Directory.exists static methods that return booleans by attempting to stat the path and checking the appropriate type. Also bump MAX_METHODS_PER_CLASS from 12 to 14 to accommodate the new Stat foreign methods, and clean up unused Scheduler imports in existing stat tests.
2016-02-21 20:23:33 +00:00
Bob Nystrom
f1babe5ad4 feat: move File.stat to Stat.path and update all references across docs, source, and tests 2016-02-07 17:56:16 +00:00
Bob Nystrom
f112722d00 feat: add File.stat() method and Stat class for filesystem metadata queries
Implement asynchronous stat() on File class returning a new Stat object with device, inode, mode, linkCount, user, group, specialDevice, size, blockSize, and blockCount fields populated from libuv uv_fs_stat callback. Register foreign method statPath_ in module registry, bump MAX_METHODS_PER_CLASS to 10, add Stat class to io.wren with indexed field accessors, update documentation index with Stat page, and include test coverage for stat on existing file and nonexistent path.
2016-01-01 17:58:44 +00:00