How does WinXP's "Send to Compressed (zipped) Folder" decide what to include in zip file? - zip

I'm not going to be too surprised if I get shot-down for asking a "non programming" question, but maybe somebody knows ...
I was zipping the contents of my subversion sandbox using WinXP's inbuilt "Send to Compressed (zipped) Folder" capability and was surprised to find that the .zip file created did not contain the .svn directories and their contents.
I had always assumed that all files were included and I can't locate which property/option/attribute controls inclusion or otherwise. Can anybody help?
Thanks, Tom
EDIT:
So, isnt there a smart way to handle the problem? The real problem (show hidden files set to true. .svn folders are not compressed because windows does not consider them as valid folders) is still un-answered.
Thanks...

Send to zipped Folder does not traverse into folders without names before dot (like ".svn"). If you had other folders that begin with dots, those would not be included either. Files without names are not excluded. Hidden attribute does not come into play.
Might be a bug, might be by design. Remember that Windows explorer does not allow creating folders beginning with dot, even though the underlying system can handle them.

It may not include files that you normally wouldn't see. Or, the files may be there, but you may be unable to see them when reopening the .zip file in explorer, because they are hidden. You may go into Tools->Folder Options, go to the View tab, and select the radio button to view hidden files and folders.

"Send to --> Compressed (zipped) Folder" creates a zip file. What it puts in there is based on your settings. It does not include hidden files with the default settings. If you have your explorer view settings set as Kibbee mentioned to "Show hidden files and folders", then "Send to --> Compressed (zipped) Folder" will put the hidden files into the zip file.
There is what I would call a bug in XP where hidden folders aren't include when recursing a folder tree. You can get them if they are in the folder that you are in. Recursing works in Vista.
Files starting with "." have no special to windows except that Windows Explorer won't let you create one. It is a valid file name though.
I would recommend using something like 7-Zip if your folders contain hidden/system files/folders.

The Windows 7 implementation of Send to Compressed Folder behaves differently - it does include files / folders beginning with a dot (e.g. ".SVN") in the zip file.

It looks like the Compressed Folder shell extension ignores directories (but not files) whose names begin with a dot, unless explicitly given as a parameter (i.e. selected for the Send To command).
It's hard to find out what else it excludes, as I can't even find out what the "compressed folder" sendto item is doing in the first place, without referring to 3rd party documentation.
Edit:
OK, the "Send to compressed folder" sendto shortcut has an extension of .ZFSendToTarget, which is handled by zipfldr.dll, which is doing all the work.
#Kibbee:
Mine does include hidden folders while zipping, though I do have "show hidden files" enabled.

Finally, I found that there is no straight forward way to ZIP the .svn folders and hence I moved to winRAR instead. Alternativaly you can also use winZip.

A compressed folder doesn't mean that it will be a .ZIP file, only the contents of the folder are compressed and to you it will look like a normal folder

Related

os.symlink and window's .lnk files are different

I am processing a big images dataset and I'm trying to reorder the files in classes, while at the same time keeping the original directory structure.
To do this, I make a second directory structure with symlinks to the files in the first one.
Everything works as it should but for one small detail: the symlinks created via os.symlink() do not show the image thumbnail, while if I make a link of the same file (e.g., via right click & send to Desktop) I do see the thumbnail.
I wanted to check how the two link files differ (note, the link files themselves, not the linked file), but if I try to drag the os.symlink-generated file in a text editor it opens the linked file instead (while this does not happen with the .lnk file generated via right-click).
What's the difference between the link files? Is os.symlink making something different than a .lnk file? If so, is there a way to get the thumbnail? And if there's no such way, how can I make a .lnk file instead?

how do I exclude tmp files in Sublime "Go to Anything"?

I've tried this but it doesn't seem to work:
{
// index_exclude_patterns indicate which files won't be indexed.
"index_exclude_patterns": ["tmp/*", "*.cache", "*.log"],
}
Perhaps I need to reindex? But I don't know how to do that...
Your issue is that the index is used to collect symbols for Goto Definition and has no effect on the list of files that are presented to you when you use Goto Anything. So adding those folders to the list of files to exclude in indexing doesn't stop you from seeing them in the file list.
Goto Anything offers you all of the files that are currently contained in your project (if you're using one) or all open folders, excluding any files that it considers to be binary, so in order to stop files from appearing in the Goto Anything panel you need to either have them removed from the project or considered to be binary.
The folder_exclude_patterns and file_exclude_patterns settings allow you to indicate what folder and file patterns respectively should not be considered part of the project. Extending those settings would remove the files from the sidebar and thus from Goto Anything.
If you want to be able to still see the files in the sidebar but not be offered the ability to jump to them with Goto Anything, you can modify the binary_file_patterns setting. That tells Sublime what files are considered to be binary, which will stop it from showing them in the Goto Anything panel or searching them via Find in Files but will still show them in the sidebar for you to manually open.
folder_exclude_patterns and file_exclude_patterns can be used in your sublime-project file (if you're using one) so that they can be set on a project by project basis. binary_file_patterns only works as a global setting, however.
Either way, you probably want to base your custom settings on the defaults or you may accidentally have files appear in your project that are currently being hidden.

How to search only in currently open files in vscode?

I usually work on larger projects with many files that would contain the search query. So I would open the files I want to modify and do a find/replace across all currently opened files. Can this be done in vs code?
The feature I'm looking for is implemented in Notepad++, but I'd prefer not to have to switch editors for this task.
For me somehow it works just by typing ./ in the files to exclude field.
The ability to search only in the open editors is in the Stable Build v1.55.
As you can see, the icon is at the end of the files to include input so you will have to have that showing (click the three dots ... just below the search options if files to include is not already showing).
"Search: target particular set of files #20530" located here: https://github.com/Microsoft/vscode/issues/20530
Is tracking a search "scope" such as "all open files".
Hit Ctrl + Shift + F and enable the icon at the end of the 'file to include' text field
I don't think there's a way to do this. You can make a feature request on github. I think an extension could do it though.
There is a checkbox for this in the "files to include" field since version 1.55 (march 2021).
The answer was already mentioned (and accepted above) indeed typing ./ in the files to exclude box of the search window will allow you to only search in open files.
However the response mentioned that he was unsure why this worked. VSCode allows you to exclude all files in a directory by writing the directory in the exclude box. The directory . is the directory where VSCode is opened ie the root directory. The filter ./ excludes all files in the VSCodes root directory so all files are excluded. However opened files ignore any exclude filter. So if you exclude all files only the opened files will be searched.
The best way to find something you are searching for within a specific file in vs code would be:
Ctrl + p then pressing # on the search bar.
It will give you a list of all functions on the file, which makes it easier to track something down.
As an alternative to using Visual Studio Code itself, you can just search the file contents within the folder where unsaved files open in Visual Studio Code are located. This would be in one of these locations depending on which OS you are running:
Linux: /tmp/ (someone else running Linux can verify this)
macOS: ~/Library/Application\ Support/Code/Backups/
Windows: %APPDATA%\Code\User\
This extension is what I use for this purpose.
You may need to change the keybinding if there is a conflict.

Ignore R.java files in Find results

When I do a Find in Path (Ctrl+Shift+F), I often get results under "Usages in Generated Code" in R.java files. When I'm searching my code, I want to do just that: search my code. Not files generated by my code.
Is it possible to get the find dialog to not show any R.java files in the results? The only results I want are those under "Found Occurrences"
Thank you!
Android Studio (like its progenitor IntelliJ) allows you to define a custom scope to help you exclude intermediates files when searching.
Here are the steps I use to set this up:
Bring up Find in Path dialog (Ctrl+Shift+F on my machine).
In the Scope area, select the Custom radio button. Then tap the "..." button on the right side of the dropdown. This brings up the Scopes dialog.
Click the "+" button on the left side of the Scopes dialog, which will bring up the Add New Scope dialog. Name it "ExcludeIntermediates".
In the Pattern field, paste in the following pattern and click OK:
!file:*intermediates*/&&!file:*generated*/
This pattern excludes R.java files and other intermediates such as layout files in exploded-aar and AndroidManifest.xml copies in filtered_manifests folders.
This pattern excludes R.java files and other intermediates such as layout files in exploded-aar and AndroidManifest.xml copies in filtered_manifests folders.
ignores R.java files
ignores all *.java files generated by Android Annotations (i.e. *_.java files)
includes strings.xml, dimens.xml, styles.xml, attrs.xml, colors.xml files
includes all xml files in layout/* path
!file:*intermediates*/&&!file:*generated*/&&file:*java&&!file:R.java&&!file:*_.java||file:*strings.xml||file:*dimes.xml||file:*styles.xml||file:*attrs.xml||file:*colors.xml||file:*layout/*xml&&!file:*build/*xml
Combined from:
https://stackoverflow.com/a/32238593/1815624
&
https://stackoverflow.com/a/32680493/1815624
To search multiple modules but ignore R.java, you could use the following mask IF you don't have any other single character file names in your project:
☑ File mask(s): ??*.*
i.e. Limit results to filenames with at least 2 characters + any extension.
If you're using Android Studio, a simple way of achieving this is to set the Scope to be Directory (rather than Whole Project) and set this directory to be your src folder - since R.java appears under build/generated it won't appear in results there.
I use "custom scopes" in Android Studio to ignore R.java files. Others had described how to create/save a "shared custom scope" which can later be uploaded to a git repository. I'm just gonna share my custom scope string which:
ignores R.java files
ignores all *.java files generated by Android Annotations (i.e. *_.java files)
includes strings.xml, dimens.xml, styles.xml, attrs.xml, colors.xml files
includes all xml files in layout/* path
file:*java&&!file:R.java&&!file:*_.java||file:*strings.xml||file:*dimes.xml||file:*styles.xml||file:*attrs.xml||file:*colors.xml||file:*layout/*xml&&!file:*build/*xml
You could just avoid all the generated files from your project, as Mike Evans suggest in this tweet
You just need add a scope excluding the pattern mentioned:

How to view changes after "Get Latest Version"?

When I Get Latest Version I often want to see what files have changed (and the diff). How do I achieve this with the least amount of IDE navigation?
Best thing to do is a folder comparison before you get the latest version. In Source Control Explorer, you can compare the differences between two server folders, two local folders, or a server folder and a local folder. Right click on the target folder and select Compare. Read more here.
This is only a solution to part of your question "what files have changed".
Once you GetLatest, go to View -> output window or (CTRL + W,O). This will show you the list of files that was replaced in the last GetLatest operation. Once you have the list of files you can do file comparison on each file to get the changes.

Resources