Windows Compressed Folders avoids Mercurial repo folder .hg - windows

Creating a zip file using Send To -> Compressed folder excludes .hg folder on Windows 7. The same behavior is seen in XP. Is it because folder name starts with a dot ?
Mercurial creates .hg folder to hold the repository. Whenever the working folder is zipped, it leaves .hg folder out of compressed .zip file.

Try using 7-zip or another archival utility to compress the files, since Windows doesn't generally like filenames starting with ..

Yes zip skips compressing the floders that start with "." on windows below version 7
See : How does WinXP's "Send to Compressed (zipped) Folder" decide what to include in zip file?
I would suggest that you tar the file before you zip it. This way you will ensure that those folders are included. Tar handles them.

Related

How to zip a folder in MacOS without creating an extra directory inside the zip file

I got a .zip file from my friend and it was compressed under windows, which contains three subfolders inside of it, and when I check the contents of it on my Mac terminal it looks like this:
Now I unzip this file and then zip it through terminal, and when I check the contents of that zip file it becomes like this:
I have googled how to zip on mac without creating a subfolder with same name but none of them solves the problem, my question is how to do the zip on Mac which makes the zip file looks exactly same with the initial one I got.
Thanks very very much
New edit:
I think I might did not do very well to summarize my problem, so the initial folder contains three sub-folders and all of them were created in windows environment and compressed on windows, when I tried to unzip it on my MacOS machine, the unzipped folder looks still good but when I do the compression on Mac and then view the .zip file through unzip -l xxxx.zip, it is giving me 6 files in which the three sub-folders are also treated as files. Based on my knowledge this is because in BSD systems all the folders are treated as files but in windows they are not, what I'm currently doing is to delete all these files that represent folders through "zip -d", which I know is very silly. I would be more than happy to talk about this from an operating system view with anybody who is interested in it. Thanks in advance.
For me this command works fine:
zip -j zippedFolder.zip myFolder/*
To unzip I used
unzip zippedFolder.zip
and I've got only the data from the folder.
Example: The folder I want to zip is on the desktop and he's called testFolder.
Open Terminal
cd /Users/yourUser/Desktop
zip -f myZip.zip testFolder/*

move files to .zip archive in windows command line

I wanted to know how to move files to a .zip archive. I'm using this code: xcopy C:\Folder C:\AnotherFolder\zippedFolder.zip. This copies the files from C:\Folder DIRECTLY into the archive, but I want to have that file in the archive (so i can doubleclick the archive and see the file unopened).
Want to do this to create an excel file with a .cmd
Use -m to import a file to a ZIP archive.
I found this on StackOverflow maybe it helps you.
How to move a file in to zip uncompressed, with zip cmd tool
But be careful it deletes the source file after it adds it to the archive. See the link for more details.
UPDATE
Instructions from this site. http://linux.about.com/od/commands/l/blcmdl1_zip.htm.
-m moves the specified files into the ZIP archive; actually, this deletes the target directories/files after making the specified ZIP archive.
If a directory becomes empty after removal of the files, the directory is also removed. No deletions are done until zip has created the archive without errors. This is useful for conserving disk space, but is potentially dangerous so it is recommended to use it in combination with -T to test the archive before removing all input files.
zip -m yourfile zip.file

Treat folders as file

Compressing a folder into a .zip file is a common way to treat a folder as file, for example, uploading a folder. Is there a faster way to "pack" the contents of a folder into a file (without taking the time to compress)?
You should use a tarfile. In unix or mac, its the tar command. On Windows there is a tool called 7-zip.
You can see more details here.

Unzip files recursively in DOS / Linux

I have a zipped folder which contains thousands of zipped folders contained in itself and that goes down the hierarchy, I have to unzip each and every file and place it in a single folder.
This task is platform independent either on windows or in linux.
Your help would be highly appreciated. Thankyou.

pack files on windows and preserve folder timestamps

I want to put a big folder on Windows box into one archive (tar, zip, gzip, whatever). Is there a tool that can preserver all folder timestamps?
The timestamps have to be preserverd after unpacking the archive on a Linux box.
Any ideas are welcome!
tar will do fine. gzip is for single file compression, zip won't preserve directory timestamps.
EDIT: Sample.
tar jcpf backup.tbz2 thedir
rm -rf thedir
tar jxpf backup.tbz2
Timestamps preserved.
EDIT2:
cygwin tar correctly preserves timestamps. Tested with tar jcf on cygwin, tar jxf on linux.
EDIT3:
WinRar preserves directory timestamps, linux unrar restores them properly.
DotNetZip preserves timestamps on folders, as well as files.
It seams that there's no soluation to all my requirements:
Pack on Windows an preserve folder timestamps
Unpack on Linux and preserve original folder timestamps
I prefer a copy/paste aka portable installation of the tool, otherwise the deployment gets to complicated.
A partial, drop in cygwin installation by just copying the necessary exe and dll files works, but doesn't preserve the folder timestamps.
Full cygwin installation is not easily possible since the windows client machines are on terminal server (see http://www.cygwin.com/faq/faq.setup.html#faq.setup.setup-fails-on-ts)
Zip doesn't work because unzip on ubuntu cannot preserver folder timestamps, even if the zip tool of choice does.

Resources