Skip to content

Commit

Permalink
Add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Dec 4, 2014
1 parent 9a46840 commit c6d1f79
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions std/file.d
Expand Up @@ -479,7 +479,11 @@ void rename(in char[] from, in char[] to) @trusted
to)));
}
else version(Posix)
{
import core.stdc.stdio;

cenforce(core.stdc.stdio.rename(from.tempCString(), to.tempCString()) == 0, to);
}
}

@safe unittest
Expand All @@ -506,8 +510,12 @@ void remove(in char[] name) @trusted
cenforce(DeleteFileW(name.tempCStringW()), name);
}
else version(Posix)
{
import core.stdc.stdio;

cenforce(core.stdc.stdio.remove(name.tempCString()) == 0,
"Failed to remove file " ~ name);
}
}

version(Windows) private WIN32_FILE_ATTRIBUTE_DATA getFileAttributesWin(in char[] name) @trusted
Expand Down Expand Up @@ -2477,6 +2485,8 @@ void copy(in char[] from, in char[] to)
}
else version(Posix)
{
import core.stdc.stdio;

immutable fd = core.sys.posix.fcntl.open(from.tempCString(), O_RDONLY);
cenforce(fd != -1, from);
scope(exit) core.sys.posix.unistd.close(fd);
Expand Down

0 comments on commit c6d1f79

Please sign in to comment.