On my system, given that forward slashes generally work insteadof backward 
slashes in Win32 paths, true, and given the current working DRIVE is c: then
the path /cygdrive/c means the same thing in Cygwin and Win32 programs ON MY 
SYSTEM,
because I have a directory c:/cygdrive with an NTFS junction c pointing to c:/.
This is a circularity in my file system, and UWin appears to setup a backupcron 
job or something, that follows it recursively.
C:\users\Jay>tlist tw1396 tw.exe   CWD:     
c:\cygdrive\c\cygdrive\c\cygdrive\c\cygdrive\c\c\dev2\cm3.archive\cm3.3\doc\help\gen_html\obliqlibm3\
   CmdLine: tw -P -l -F - -G - "-e        if (                path == 
'(/afs|/backup|/dev|/proc|/tmp|/usr/tmp|/var/tmp)?(/*)'                )        
                status = SKIP;        else if (                type == LNK &&   
             level < 3 &&                path == 
'(/home|/usr/local|/usr/common)?(/*)'                )                        
status = FOLLOW;        " -d /
What to do?
I can probably at this point abandon this scheme of mine.It did serve a purpose 
of not needing to translate paths between Cygwin and Win32.
What is general solution on Unix to avoid following circularities in the file 
system forever?I have seen various switches to various utilities for varying 
treatment of symbolic links and Ithink even hard links. I realize that hard 
links are the same as "no links", except code cannotice a link count > 1 and/or 
can notice hitting the same inode number more than once in a walk.
I thought about this some myself in a Win32 context.I had two pieces of code.A 
recursive diff and a variant of "du".
For "du", I just changed it to never follow NTFS reparse points, which is what 
"junctions" are.
(Backing up a sec: NTFS has always has hard links for files, and not for 
directories.Windows 2000 added "reparse points" for directories and files, 
which are a general mechanism andthen one application of them is "directory 
junctions", which is essentially directory symlinks.)
The reparse points do take a small amount of diskspace for some "metadata" and 
do point to somethingthat could take significant space. This interpretation is 
not clearly always correct, but for mypurposes ok. That is, a) if you happen 
upon the junction target as part of the du walk anyway,its space will count, 
just once, which is "correct", assuming you don't care to know what it costs to 
replicate to a system that doesn't support junctions b) if you really want 
toknow how much space this tree will take to replicate and you DON'T otherwise 
hit the target, thenthe result is indeed wrong.I was most interested in the 
space taken on the current system, not a replica, and I generallywould hit the 
junction target since I ran "du" from "high enough up".
For the recursive diff, I added a manual flag to never follow reparse points.I 
really wanted something "automatic" but couldn't come up with one, esp. not a 
very small changesince none of the other users had hit this, only me, and the 
usage scenarios were broader.
It seems like what you often want is to follow every link/junction, but only at 
most once.You also might want to follow zero times. I think limiting the walk 
to one ought to be easily coded.Deciding between zero and one I don't think is 
automatically decidable.
I have long since concluded that file systems are tremendously more complicated 
than mostpeople or code realizes. Probably even more than I realize.
One small tangential example I will give is that of case sensitivity.A lot of 
people think they get this: Unix is case sensitive, Windows is not.But it is 
much more complicated than that.First of all, it is dependent on the file 
system implementation, not so much the "operating system". Either "operating 
system" can see either file system implementation, definitely remotely and 
pretty  much locally too. The "operating systems" are very extensible, via 
writing new file system implementations, and have been much extended.Second of 
all, you can hop between file system implemenations, such as via symlinks, or 
NTFS junctions.
Even on a local Windows system, you can have a FAT volume mounted in an NTFS 
directory.
Even what "case insensitivity" means varies, once you start having characters 
beyond 7 or 8 bits.
 
For now I stopped the uwin master service and set it to on-demand start.
I'm not sure I needed anything it was doing.
Later I'll probably remove my circularity. And edit the crontab or whatnot.
 
I see tw has options for symbolic links.
tw is not necessarily at fault, maybe just the default setup and its use of tw?
Setup finished, but what it left behind is what I mean.
 - Jay
_______________________________________________
uwin-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/uwin-users

Reply via email to