Associating File Extensions to a files with variable extensions - windows

In Windows, I have a set of files in a folder that all have similarly formatted text content, but with different extensions based on a timestamp. For example, assume two files named data.20140424 and data.20140423 for two days. Each day brings a new file with a new extension.
Is there a way to associate all the extensions with a single program that can view the files? Do I need to have a registry entry for each extension? Is there an alternative way to associate files besides extension, like with mime type or full filename?

You need a registry entry for each file. If you're on windows, double-click the file, select the program to open it with. Make sure "use this program every time" checkbox or similar checkbox is checked. It will open and you won't need to do this again.

Related

How do you limit a Mac Finder search to only show .jar files?

While trying to find specific .jar files using the Mac Finder, I cannot limit the search criteria (an option found by clicking the settings gear icon and then Show Search Criteria by Kind of .jar.
While trying setting Kind to Other and using .jar or *.jar, no results are returned for jar files that I know exist on my computer. I have tried the same for .tar as well.
Is there a way to limit a Finder search to specific jar files?
Almost, the literal kind of .jar files is Java JAR file
You can check the Spotlight attributes of a file yourself pretty simply.
Open Terminal.app.
Type mdls followed by a space character.
Drag the file into the Terminal window.
Press return.
After selecting a New Smart folder from the finders file menu. Using the criteria lines can contain multiple statements by clicking the plus button.
Additionally if you hold down the option key, the plus turns into an options statement in which you can select additional criteria such as "all the following are true or false"
You can create multiple condition criteria using this method. You might need to logically experiment with where you place the statements in such a way it returns what's expected. As the order in which you create them is the order the machine goes through the workflow.

Prevent Xcode from opening new files

Is there any way to prevent Xcode from opening brand new files? Let me explain. Everytime I create a new file (Xib, .swift, .storyboard, etc...) Xcode opens that new file automatically in the standard editor. This functionality kinda annoys me because something I just want to create the file and maybe open it on the assistance editor instead or just to work on the file later. I tried changing some of the Xcode's behavior but I don't see any ways where I can trigger an action when certain events occur (like creating a new file).
Well here's one way:
Create a folder full of empty files of various types (with various extensions) that you typically create. Then whenenver you want a new file, rather than telling Xcode to create a new file, use the "Add Files to ..." command and choose one of those files. Just remember to also check the checkbox "Copy items if needed".
Doing this won't open the added file.
As an added benefit, you could also make some versions of these files pre-seeded with code or comments or whatever else that you often keep re-typing into many of your new files.

Why doesn't .gitignore.txt file show it's name in windows10?

Recently I scaffolded a project with webapp generator. It created two files .gitignore and .gitattributes. Both show a file extention of type Text Document But when I press F12 to edit any one's name then it has empty name. Here is the snapshot:
My question is why don't window show the name as .gitignore?
There is nothing special with those files. This visual guide may help you.
Also in Windows 10 you may simply try this option in View Tab of Folder Explorer:
After looking and reading closer, it seems that the "problem" is that with the default settings of Explorer "known" file-name extensions (like e.g. .txt) are just not shown.
So if you name a file .txt (full file-name) then it will show up as empty and with no name.
Dot-files are not having any "extension" to their file-name. The full file-name of e.g. the Git ignore file is .gitignore.
It comes from the Unix world where file-names doesn't have to follow the DOS and Windows name.ext scheme, and means that the file is hidden.
Windows since long allows arbitrary file-names as well, but in a name.ext scheme such files doesn't have a "name" only an extension.
Windows interprets .gitignore as an empty file name with the extension "gitignore", and thus shows an empty name be default. To properly see its name, open the folder's properties and check the "Show All File Extensions" option.
I don't have an answer, but I have a preference. I'd prefer not to show all extensions just to be able to see my .gitignore files in Windows10 file explorer.
I'm hoping to extend OP's question by showing I DO SEE .babelrc and .eslintrc, and w/o seeing all file extension setting being set to "on".
It seems, on my own system, that the associations for BABELRC and ESLINT(RC|IGNORE) are, maybe, set automatically by VSCode? In any case, why can I see those "." files, while the in.json is showing with hidden extension, but I can't see .gitignore?

How do I configure TortoiseHg to open a file in the right program based on its extension?

I'm using TortoiseHg v2.2.1 with Mercurial 1.9 in WindowsXP. How do I configure TortoiseHg to view a file based on the application Windows has associated with its extension?
For example, if I have a .docx file in the repository and I'm looking at its revision history, I'd like View at revision... to open the selected revision in MS Word. Likewise for other binary file types like ppt and xls, which I can't view using the default text editor or kdiff3.
Can I leverage that Windows already knows what program to use to open certain types of files or will I have to manually configure each file type of interest within the Tortoise config files?
I've found several SVN scripts in the TortoiseHg\diff-scripts folder that look like they solve a similar problem for diffing binaries rather than simply viewing them, but those don't seem to be activated and I'm not sure what if anything I need to mod in the MergePatterns.rc or Mercurial.ini files to make this all work.
To make "View at Revision" use whatever program is associated with the file's extension, try this trick: In the "Global Settings" in the "TortoiseHg" section, enter start "" as "Visual Editor". Note the empty "". This is necessary so that start will not use the file name, which gets passed in quotes by TortoiseHg, as the window title.

How to setup Installer project with conditional file copying

I am building a VS 2010 installer, and I want to copy files to app folder depending on what options I select in UI (UI is not simple, so the only option is to show custom dialogs in Install custom action).
The problem is that custom action is actually executed after files are copied already.
One possible solution I can think of is to install all these files into the app dir, and then delete some unnesessary files in custom action. But these files are "secure" in some way, so I don't want to copy them to filesystem, even for a short period of time.
Any thoughts?
If your files shouldn't ever be on the filesystem, you have a problem in the requirements. The .msi storage itself is an open format and can be read by many tools, so if someone knows the file it's possible for them to find and extract it manually.
I agree that it's better to avoid deleting the files after they've been installed for two reasons. One: it avoids wasted work, and two: it won't cause repair scenarios due to missing files that Windows Installer thinks should be present. You should probably figure out how to determine whether these files should be present at an earlier stage of the installation, and set properties that cause this to happen (disable components by condition, or change feature states).
Most controls in MSI dialogs use installer properties. For example, a checkbox may use a property named MY_CHECKBOX which is set to a value or it's empty, based on whether the checkbox is checked or not.
These properties can be used to condition files:
select your setup project in Solution Explorer
click File System Editor button from Solution Explorer top pane
select the file you want to condition
in its Properties pane set Condition field to the condition you want, for example
MY_CHECKBOX = "value"

Resources