aboutsummaryrefslogtreecommitdiff
path: root/jim-aio.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-10-13 21:31:08 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-30 10:46:44 +1000
commit15f979c966ad8ea11e62f58a0f77ea52ffe8c48f (patch)
tree913783a13c63bdd26a86fc6fc7ed3746c0ae8d9b /jim-aio.c
parentb5a3077ecffc22c4cbd5b4f0a962dc57073d3ee1 (diff)
downloadjimtcl-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>
Diffstat (limited to 'jim-aio.c')
-rw-r--r--jim-aio.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/jim-aio.c b/jim-aio.c
index 40daded..21a16d2 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -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?",