Set property of folder?
-
Hi, is there any way to set property of a folder as zip-folder? I create a new folder using CreateDirectory() for some data from my program, and set this folder as compressed, now i need to set this same folder as zipped folder!! I don't want to create first a zip file and add some files to them, i create a compressed folder with CreateDirectory() and add some files to them, and now i like to set them as compressed(zipped), is there any way how to do this?? Any idea how to do this?? Thanks for any help! Arrin
-
Hi, is there any way to set property of a folder as zip-folder? I create a new folder using CreateDirectory() for some data from my program, and set this folder as compressed, now i need to set this same folder as zipped folder!! I don't want to create first a zip file and add some files to them, i create a compressed folder with CreateDirectory() and add some files to them, and now i like to set them as compressed(zipped), is there any way how to do this?? Any idea how to do this?? Thanks for any help! Arrin
Feel free to correct me but... There is no such thing as a "zip-folder". There are normal directories, and NTFS can compress files in it. You gain space, and lose time. There are zip files. Explorer very kindly has an already installed shell extension which makes them look a lot like a directory. Explorer is lieing to you, in the interests of ease of use. This is good. I can't really help you, as it sounds like you already know how to do this, you just don't like it. Did that make sense? Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
Feel free to correct me but... There is no such thing as a "zip-folder". There are normal directories, and NTFS can compress files in it. You gain space, and lose time. There are zip files. Explorer very kindly has an already installed shell extension which makes them look a lot like a directory. Explorer is lieing to you, in the interests of ease of use. This is good. I can't really help you, as it sounds like you already know how to do this, you just don't like it. Did that make sense? Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
Hello Ian, thanks for answer. I don't know how to do this, if yes, i will never ask something here, the time is to expensive for that! You know that, when you make a right mouse click on a folder or file in explorer, its open a menu, and one of choices is "Send to archive" (or similar, sorry about my english), that is what i mean!! If this don't work, i know here is a Zip Utils that i can use, but i like to try this first! I can only show my try, its like this:
DWORD dwFileMask; long mask; dwFileMask = GetFileAttributes(csCurFolder); mask = dwFileMask; if(!(dwFileMask & FILE\_ATTRIBUTE\_ARCHIVE)) // set my new createt folder as a archive :) { mask = dwFileMask | FILE\_ATTRIBUTE\_ARCHIVE; SetFileAttributes(csCurFolder, mask); }
but thanks for your help :) Arrin
-
Hello Ian, thanks for answer. I don't know how to do this, if yes, i will never ask something here, the time is to expensive for that! You know that, when you make a right mouse click on a folder or file in explorer, its open a menu, and one of choices is "Send to archive" (or similar, sorry about my english), that is what i mean!! If this don't work, i know here is a Zip Utils that i can use, but i like to try this first! I can only show my try, its like this:
DWORD dwFileMask; long mask; dwFileMask = GetFileAttributes(csCurFolder); mask = dwFileMask; if(!(dwFileMask & FILE\_ATTRIBUTE\_ARCHIVE)) // set my new createt folder as a archive :) { mask = dwFileMask | FILE\_ATTRIBUTE\_ARCHIVE; SetFileAttributes(csCurFolder, mask); }
but thanks for your help :) Arrin
The archive attribute for a folder is used by backup programs - it's not the same thing as a zip file. There are zip library articles here on CP. I don't know a specific one to recommend, but CP is searchable. Once you've read several, you will know more than me about them. 1/ So, make the files you want. Put them somewhere temporary. 2/ Make a zip file containing those files. <-- this is the hard bit, but look at CP articles. 3/ Delete the original temporary files. The right-click thing in explorer is a context menu extension, and just does step 2 above. Good luck, Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]