MyEarth Posted September 26, 2017 Share Posted September 26, 2017 (edited) Hi guys, Long time no see. I need an help with this task. I need my script treat a "folder as a file" and something don't require external DLL or software. I don't need-want any compression, fastest as possible. Just move a folder inside a "container" and extract from a "container", nothing else, but in pure autoit language. Searching online i have see the TAR is what i can use: https://en.wikipedia.org/wiki/Tar_(computing)#Header But i don't have find a UDF or library in pure autoit can use that, only external software or DLL. Any suggestion-code are welcome but please remember my "requirements" Thanks for the help Edited September 26, 2017 by MyEarth Link to comment Share on other sites More sharing options...
water Posted September 26, 2017 Share Posted September 26, 2017 All compression related UDFs can be found here: https://www.autoitscript.com/wiki/User_Defined_Functions#Data_compression My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
MyEarth Posted September 26, 2017 Author Share Posted September 26, 2017 I have check it out but noone seems to meet my requirements... Thanks Link to comment Share on other sites More sharing options...
water Posted September 26, 2017 Share Posted September 26, 2017 I'm not sure I fully understand your reqirements. Using ZIP to create a ZIP-Archive should be all you need. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
MyEarth Posted September 26, 2017 Author Share Posted September 26, 2017 (edited) My reqirements are: 1) Pure autoit, no external .exe or .dll 2) No compression at all, i don't need compression since compression require time. Faster as possible, in the limit of autoit. 3) Move a folder and its content inside a .xyz file 4) Extract a folder and its content from .xyz file For this reason i have think to use the .tar, no compression and is just a container. But doesn't exist actually a UDF that use .tar and meet point one. But i don't care the file format, i have think to .tar but can be anything. Edited September 26, 2017 by MyEarth Link to comment Share on other sites More sharing options...
water Posted September 26, 2017 Share Posted September 26, 2017 If you just need a container without compression I suggest this UDF: My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
MyEarth Posted September 26, 2017 Author Share Posted September 26, 2017 Very cool! But there are a couple of big problems. 1) It works on file so i lost the folder structure, and that's the main problem 2) Don't move but copy the file inside the container, i need a "cut" operation Is very similar to my goal but i need the folder tree structure... Link to comment Share on other sites More sharing options...
water Posted September 26, 2017 Share Posted September 26, 2017 This ZIP UDF seems to use a DLL that is part of the Windows System. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
MyEarth Posted September 26, 2017 Author Share Posted September 26, 2017 Sorry if I seem annoying but it use compression...but many thanks for the effort, i'l really apprecciate it Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 26, 2017 Moderators Share Posted September 26, 2017 MyEarth, So you want a container which holds a folder tree structure - the OS already gives you that, it is called a folder! Or are you really asking for a way to hide the structure inside a folder? If so, how do you expect to be able to access it yourself? And why do you need to do this in the first place? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Danyfirex Posted September 26, 2017 Share Posted September 26, 2017 Hello. as soon I can understand You could probably do something like Building your own file format and using FIlelisttoarrayRec and File write/read. Basically You create a File Header base in FileListToArrayRec use some indexs(for easy find your files data in your file) and write files append to your own format. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Gianni Posted September 26, 2017 Share Posted September 26, 2017 (edited) I think you could use the "MakeCAB" and "EXTRACT" dos commands. p.s. don't ask me how to use those commands.... Edited September 26, 2017 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
MyEarth Posted September 27, 2017 Author Share Posted September 27, 2017 (edited) @Chimp MAKECAB work only for files @Danyfirex in theory, but pratically? How to preserve folder structure? How to move instead of copy? @Melba23 Folder <> File or software like 7-Zip and others who invented them to do? Edited September 27, 2017 by MyEarth Link to comment Share on other sites More sharing options...
kosamja Posted September 27, 2017 Share Posted September 27, 2017 @MyEarth you dont know what you want, do you? software like 7-Zip copies files to archive and compresses them and you said you dont want that, but still you are mentioning 7-zip as example. Sounds like contradiction to me... Link to comment Share on other sites More sharing options...
MyEarth Posted September 27, 2017 Author Share Posted September 27, 2017 (edited) @kosamja Yeah i know what i want thanks, read post #5 if you don't. 7-Zip, i have mention it only ONCE and i can't use since i need an internal solution, can store the folder-file without compress. Every "compression software" can store the file without compress. TAR file is the same. Edited September 27, 2017 by MyEarth Link to comment Share on other sites More sharing options...
ripdad Posted September 27, 2017 Share Posted September 27, 2017 You could always embed a dll in your code, and then run it from there. There are several examples in the "Autoit Example Scripts" forum. I pretty sure thats as close as you are gonna get. All you need is a container. Pick one. Zip, Rar, 7zip, Tar, etc. By the way, you could also use a "Virtual Disk Drive" as a container. It's a file that works just like a hard drive. ImDisk is one of them. Download here: http://imdisk.en.lo4d.com/ "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Gianni Posted September 27, 2017 Share Posted September 27, 2017 13 hours ago, MyEarth said: ... MAKECAB work only for files ... ... wrong answer ... If you use MakeCAB in the right way, you can store files and subdirectory information so that when you extract files using the expand command (expand -R -F:* mycab.CAB mydir) , those files are saved in the specified directory, recreating the tree path. (You can also create autoextracting files) From a quick search I see that a fast way to use is by creating a text file( with .ddf extension) containing directives for the MakeCAB command. You will execute MakeCAB with /F parameter followed by your directives file and MakeCAB will perform what you asked within the directive file.makecab /F directives.ddf Have a look to the following link for an example on how to specify the destinations paths for the files (.Set DestinationDir): http://dataerror.blogspot.it/2005/10/makecab-part-3-compress-multiple-files.html ... maybe, you could use the _FileListToArrayRec AutoIt function as a base to create a "directive" file for th MakeCAB command.... Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
ripdad Posted September 29, 2017 Share Posted September 29, 2017 (edited) Actually, after some thought on the matter, it shouldn't be too difficult to create your own container in pure Autoit. Using _FileListToArrayRec() to get a list of files, then Base Encode the files into a container with a unique marker for the path and filename. Something like this inside the file container... ### C:\temp\somefile1.txt (Base Encoded file here) ### C:\temp\somefile2.txt (Base Encoded file here) ### C:\temp\somefile3.txt (Base Encoded file here) To reverse, extract using the markers, then Base Decode and write to their perspective paths. I will have to play with it some over the weekend, maybe. But I don't think I would have a use for it. I'm satisfied with using zip or rar. - edit - If you don't care about the size of the container, you could use Binary instead of Base Encode. But, it would be twice the size of the files. Edited September 29, 2017 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now