Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F115551174
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
Sun, Jun 1, 17:16
Size
668 B
Mime Type
text/x-c
Expires
Tue, Jun 3, 17:16 (2 d)
Engine
blob
Format
Raw Data
Handle
26521600
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