c# - File.SetAttributes() not working on USB key as expected -
c# - File.SetAttributes() not working on USB key as expected -
fileattributes attrs = file.getattributes( path); file.setattributes( path, fileattributes.hidden ); attrs = file.getattributes( path);
this code snippet works on ntfs file scheme (c:\temp...\whatever_file). when seek perform same operation on usb key (fat file system) never sets hidden attribute. if manually set in windows explorer, first line returns correctly set. 3rd line (checking it) never sets if not set.
i'll give free puppy whoever can tell me why. :)
update: when doesn't work, mean when go windows explorer , @ file doesn't have hidden attribute set. in fact, when sec getattributes shows bit set. in windows explorer not set. if remove usb key , reinsert sure refreshes correctly.
thank input, neglected @ rest of code recursively turn off read-only attribute on of files i've written usb key, negating whatever i'd done before.
i repent in dust , ashes.
c# usb fat file-attributes
Comments
Post a Comment