From 7e5c126718dc5268dd761222e2b8a094e9703476 Mon Sep 17 00:00:00 2001 From: navarro Date: Fri, 2 Mar 2012 19:25:50 +0100 Subject: [PATCH] Update file.c example since new modifications in surf and simix for storage. --- examples/msg/io/file.c | 14 +++++++++----- examples/platforms/storage.xml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/msg/io/file.c b/examples/msg/io/file.c index 29ebc857e2..69e45db4fa 100644 --- a/examples/msg/io/file.c +++ b/examples/msg/io/file.c @@ -17,20 +17,24 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_file, int host(int argc, char *argv[]) { m_file_t file; - file = MSG_file_open("test.txt","rw"); + char* mount = bprintf("C:"); + + file = MSG_file_open(mount,"test.txt","rw"); XBT_INFO("Host '%s' open %p",MSG_host_get_name(MSG_host_self()), file); - size_t read = MSG_file_read(NULL,0,0,file); + size_t read = MSG_file_read(mount,NULL,0,0,file); XBT_INFO("Host '%s' read %zu", MSG_host_get_name(MSG_host_self()), read); - size_t write = MSG_file_write(NULL,0,0,file); + size_t write = MSG_file_write(mount,NULL,0,0,file); XBT_INFO("Host '%s' write %zu", MSG_host_get_name(MSG_host_self()), write); - int res = MSG_file_stat(0,NULL); + int res = MSG_file_stat(mount,0,NULL); XBT_INFO("Host '%s' stat %d",MSG_host_get_name(MSG_host_self()), res); - res = MSG_file_close(file); + res = MSG_file_close(mount,file); XBT_INFO("Host '%s' close %d",MSG_host_get_name(MSG_host_self()), res); + + free(mount); return 0; } diff --git a/examples/platforms/storage.xml b/examples/platforms/storage.xml index 9495b8982e..7fca614b0a 100644 --- a/examples/platforms/storage.xml +++ b/examples/platforms/storage.xml @@ -31,7 +31,7 @@ - + -- 2.20.1