Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F114923668
rename.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, May 28, 14:50
Size
668 B
Mime Type
text/x-c
Expires
Fri, May 30, 14:50 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26451358
Attached To
R6832 iCAPs public
rename.c
View Options
/*
* Copyright (C) 2011, Robert Oostenveld
*
* This implements an atomic rename by calling the UNIX/POSIX operating system command.
*
*/
#include <stdio.h>
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
char *old, *new;
int status;
if (nrhs!=2)
mexErrMsgTxt("incorrect number of input arguments");
if (!mxIsChar(prhs[0]))
mexErrMsgTxt("invalid input argument #1");
if (!mxIsChar(prhs[1]))
mexErrMsgTxt("invalid input argument #2");
old = mxArrayToString(prhs[0]);
new = mxArrayToString(prhs[1]);
status = rename(old, new);
plhs[0] = mxCreateDoubleScalar(status);
return;
}
Event Timeline
Log In to Comment