setAttributes call error
Jay Norwood
jayn at prismnet.com
Mon Mar 17 15:18:55 PDT 2014
I updated to 2.065, and using visualD for the build on Windows.
VisualD finds this setAttributes call in file.d, but the build
fails to find it in the library. Does this build for someone
else?
import std.file;
void clrReadOnly( in char[] name)
{
uint oldAtt = getAttributes(name);
version (Windows){
import core.sys.windows.windows;
oldAtt ^= FILE_ATTRIBUTE_READONLY;
}
setAttributes(name, oldAtt);
}
int main(string[] argv)
{
clrReadOnly("c:\tf.txt");
return 0;
}
--------
Error 1 Error: undefined identifier setAttributes, did you mean
function getAttributes? D:\setatt\setatt\setatt\main.d 10
void setAttributes(in char[] name, uint attributes)
{
version (Windows)
{
cenforce(SetFileAttributesW(std.utf.toUTF16z(name),
attributes), name);
}
More information about the Digitalmars-d-learn
mailing list