diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-10-13 21:31:08 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-30 10:46:44 +1000 |
commit | 15f979c966ad8ea11e62f58a0f77ea52ffe8c48f (patch) | |
tree | 913783a13c63bdd26a86fc6fc7ed3746c0ae8d9b | |
parent | b5a3077ecffc22c4cbd5b4f0a962dc57073d3ee1 (diff) | |
download | jimtcl-15f979c966ad8ea11e62f58a0f77ea52ffe8c48f.zip jimtcl-15f979c966ad8ea11e62f58a0f77ea52ffe8c48f.tar.gz jimtcl-15f979c966ad8ea11e62f58a0f77ea52ffe8c48f.tar.bz2 |
Add aio '$handle filename'
Retrieves the original filename
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim-aio.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -632,6 +632,14 @@ static int aio_cmd_tell(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } +static int aio_cmd_filename(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +{ + AioFile *af = Jim_CmdPrivData(interp); + + Jim_SetResult(interp, af->filename); + return JIM_OK; +} + #ifdef O_NDELAY static int aio_cmd_ndelay(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { @@ -798,6 +806,10 @@ static const jim_subcmd_type aio_command_table[] = { .function = aio_cmd_tell, .description = "Returns the current seek position" }, + { .cmd = "filename", + .function = aio_cmd_filename, + .description = "Returns the original filename" + }, #ifdef O_NDELAY { .cmd = "ndelay", .args = "?0|1?", |