www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - setAttributes call error

reply "Jay Norwood" <jayn prismnet.com> writes:
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);
     }
	
Mar 17 2014
parent "Jay Norwood" <jayn prismnet.com> writes:
Sorry, this is my fault.  I had an old installation of 2.064 
still in the path.
Mar 17 2014