[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Portably iterate over a directory
- From: David Given <dg@...>
- Date: Tue, 01 Dec 2009 13:20:30 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Robert Raschke wrote:
> I'm not 100% sure about Windows folder structures, but you can get links
> there too. So a little bit of investigation would be needed to figure
> out what dir does with those. Although, I think cyclic folder structures
> are not as common in Windows as they are on Unix.
Yup. Windows calls them 'junction points', but they are basically just
symbolic links. The tool to make them is called junction.exe and is
available from sysinternals:
Dead handy, too. I've used them to patch a link from a USB stick
containing sensitive source code into a third party build tree. The
build system thinks the contents of the USB stick is a subdirectory;
yank the stick, the directory vanishes.
As for OS support, they're handled rather badly. dir correctly shows
them as type JUNCTION (distinct for DIRECTORY or FILE), but XP explorer
treats them as directories, so deleting them deletes the files being
pointed at! Vista Explorer allegedly understands them.
Most third party applications treat them as directories. Yes, if you
have loops they will get very, very confused.
We now return you to your regularly scheduled discussion.
┌─── ｄｇ＠ｃｏｗｌａｒｋ．ｃｏｍ ───── http://www.cowlark.com ─────
│ "Sufficiently advanced incompetence is indistinguishable from
│ malice." -- Vernon Schryver
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----