1

so recently, a technologically clever fellow hid all the files in my school's most frequently accessed and most important public networked mounted drives.

now, as the problem hasn't yet been fixed, i see it as an opportunity to expand my knowledge on python. I would like if there is a module that allows me to edit the properties of files in folders in general. !!EDIT: Windows folders.

not the /contents/, the properties. like the date/time accessed, images of mp3 music, and more importantly, the hidden/not hidden status of files.

ajazz
  • 83
  • 1
  • 7
  • Right click on the folder, select properties, and uncheck the hidden check box. In other words do the same as this evil genius did originally. – David Heffernan May 14 '14 at 18:38
  • i was talking in terms of making a program do it. automatically. perhaps i should have specified that. (and i mean a module that would allow me to make a program to do it) – ajazz May 14 '14 at 18:41
  • This link discusses the same topic: http://stackoverflow.com/questions/549109/hide-folders-file-with-python – Dan Hogan May 14 '14 at 18:43
  • @dan30484 I don't think it does. The link covers hiding a file, but OP is asking for how to edit properties in the general case. – Michael0x2a May 14 '14 at 18:44
  • You could write such a program to do this task. Why would you do so? It already exists. – David Heffernan May 14 '14 at 18:44
  • 1
    @David, I believe the author gave the reason as "i see it as an opportunity to expand my knowledge on python". – huu May 14 '14 at 18:45
  • Micheal's got it right, mostly. the reason i want to write a program to do it is because i can use that module and that knowledge to do other things in the future. – ajazz May 14 '14 at 18:45
  • 1
    OK. So pick a topic to ask. Your question covers enumerating files, file system attributes and meta data. Three very different topics. Pick one. Then do some research and ask a question if you get stuck. Anyway, asking for a library recommendation is off topic here. I do think you need to refine your question somewhat. – David Heffernan May 14 '14 at 18:47
  • This [post](http://stackoverflow.com/q/1512435/646543) might be useful, though it doesn't look like there's any simple solution or library to what you're asking, unfortunately. – Michael0x2a May 14 '14 at 18:51

1 Answers1

1

You can use the Python for Windows package to access a wide range of Windows API's. In particular, the SetFileAttributes function will be useful. You can see an example here. There are other API's such as GetFileAttributes and GetFileAttributesEx to can use to get more information. they'll be defined in the same place as SetFileAttributes.

tdelaney
  • 73,364
  • 6
  • 83
  • 116