Home
Contact
Forums
Awards
Press
Subscribe
Social
About
 ___
Authors:
Jason Doucette
Matthew Doucette
 ___
Games:
Duality ZF
Decimation X
Score Rush
 ___
Articles:
Blog
Games
Tech
Windows
Webmaster
Coding
 ___
Web Utilities:
Domain Hacks
Suggest
 ___
Freeware:
ZoomView
AntiSpam Mailto
 ___
Quotes:
Inspirational
Intelligence
Education
Action
Scientific
Chess
Financial
Programming
 ___
Social:
YouTube
Facebook
Twitter
 ___
Books
Videos
Wallpapers
 ___
Music
Color List
TI-99/4A
Parsec
Optical Illusions
Web Design
Trivia
Domains
Donations
Copyrights
Disclaimer
Links
 ___
Forums
About
Contact
How Connected Files are Made, and their Problems


Friday, July 16, 2004
By: Jason Doucette
(printer friendly version)

Have you ever used the File -> Save As... selection in Internet Explorer?  You can use this to save an entire webpage to your hard drive, including all of the images required for it to display properly; not just the .html files.  Select 'Web Page, complete (*.htm; *.html)' for the 'Save as type:' selection, and an HTML file with the name of the web page's title will be saved, with a folder similarly named that contains all of the web page's contents.  Do this for the page you are viewing now, and save it to the Desktop, and have a look.

Now delete just the .html file.  What happens?

The folder disappears, as well.  This is what Microsoft calls 'Connected Files'.

You must be very careful when managing a connected file, because whatever you do to the file or the folder determines the fate of both of them.  If you are a user that presses 'Shift + Delete' often (to immediately delete a file, without retiring it to the Recycle Bin first), then doing so on the .html file will also delete, without chance of restoration, the folder with all of the images, as well.

True story:  Some guy created a webpage by starting with the HTML code of another site by using this 'Save As...' feature.  After he was satisfied with his changes, he deleted the useless folder of images.  He used Shift + Delete because he know he had no use whatsoever for the images folder.  Bang!  His work was deleted with it, with no chance of recovery.  This is one reason to be aware of how connected files work.  (And, it is also a reason to never use Shift + Delete, especially not regularly, because it becomes habit.  Use the Recycle Bin.  It's there for a reason.  It doesn't slow your computer down.  And you just never know when you may want something restored.)

 

Technical Details

So, what kind of fancy magic is going on behind the scenes to connect files and folders together?  After all, looking at the properties of each does not reveal anything unusual.  I finally found an MSDN page on the SHFileOperation function that describes it.  I will quote the relevant blurb of text here, since it is unlikely that any non-programmer wishes to read the rest of it:

Connecting Files

With Microsoft® Windows® 2000 or later, it is possible to connect an HTML file with a folder that contains related files such as Graphics Interchange Format (GIF) images or style sheets. If file connection is enabled, when you move or copy the HTML file, the folder and all of its files are moved or copied as well. Conversely, if you move the folder with the related files, the HTML file is also moved.

The HTML file must have a .htm or .html extension. You create the connection to the related files by placing the folder that contains them into the same folder as the HTML file. The name of the folder that contains the connected files must be the same as the name of the HTML file followed by "_files" or ".files" (this is case sensitive; for example, ".Files" does not work). An example is given here.

1. Create a file named Test.htm in the C:\Files directory (C:\Files\Test.htm).
2. Create a new folder named Test.files in the C:\Files directory (C:\Files\Text.files).
3. Populate the folder with a few files. Any file placed in this folder is connected to Test.htm.
4. Move or copy the Test.htm file to the C:\Files2 directory.
5. Note that the Test.files directory is now found in the C:\Files2 directory as well.

File connection is enabled by default. It can be disabled by adding a REG_DWORD value, NoFileFolderConnection, to this registry key.

HKEY_CURRENT_USER -> Software -> Microsoft -> Windows -> CurrentVersion -> Explorer -> NoFileFolderConnection

Setting NoFileFolderConnection to 1 disables file connection. If the value is set to zero or is missing, file connection is enabled.

 

About the Author:  I am Jason Doucette of Xona Games, an award-winningteam-of-two indie studio concentrating on "intense retro" games (Xbox LIVE, PSN, WiiWare, and Windows PC). We've released Decimation X (XBLIG), a 1-4 player shmup, #1 best selling and #1 top rated XBLIG in Japan. We're working on Duality ZF (XBLA), a groundbreaking 1-4 player shmup, which placed #1 in Canada and #5 in the world in Microsoft's Dream Build Play 2010 contest. It features dual play, the ability to control two fighters at once, and a massively upgradable 32-stage spread/laser weapon system. 4 player dual play allows up to eight fighters at once.  Many of these features are never before seen shoot'em up firsts. Both games feature beautiful electronic Imphenzia soundtracks.  Help spread the word with our official dualityzf.com and decimationx.com websites.

P.S. Watch out for Score Rush (official website scorerush.com), another 1-4 player shmup. Coming soon to XBLIG.

*Shmup also known as: shoot'em up, 2D shooter, scrolling shooter, space shooter, spaceship shooter, retro shooter, etc.



> Home
> Discuss
> Contact
  ©Xona.com™


Email:
"Xona Games" and "Xona.com" trademarked and copyrighted by Xona Games Inc.,
Jason Doucette, and Matthew Doucette.
6,775,318 page views (since 2004-Jul-27)
© Xona Games Inc.