RV: DOS undocumented feature
- Posted by rforno at tutopia.com Jul 22, 2002
- 360 views
I discovered that attributes (hidden, system, etc.) have nothing to do with the ability to read a file. The only problem lies in that the culprit file is locked by another program, that can be the same program. For example, if you issue: ex whatever > xx then sometimes (not always, I don't know why), the whatever program cannot read from xx. Then, the problem reduces itself to this: how to know if a file is locked before actually reading it, because if you attempt to read it, you get the "Critical error" and have to key i (ignore). ----- Original Message ----- From: Ricardo M. Forno <rforno at tutopia.com> To: <EUforum at topica.com> Subject: RE: DOS undocumented feature > Yes, it is a good idea. > I have another one: store the attributes, set them to no-system, no-hidden, > read the files, and afterwards restore the original attributes. It is a bit > dangerous, however. > Independently of attributes, in Windows there are some files that can't be > accessed, for example the swap file. There are some others that are "in use" > by some other program, and can't be deleted, for example, without restarting > Windows. I found a way to treat some files that can't be deleted; they *can* > be moved to some other directory, and then you can delete them. Strange, uh? > ----- Original Message ----- > From: Kat <gertie at PELL.NET> > To: EUforum <EUforum at topica.com> > Sent: Sunday, July 21, 2002 5:11 PM > Subject: Re: DOS undocumented feature > > > > > > On 21 Jul 2002, at 12:15, Robert Craig wrote: > > > > > > > > Ricardo Forno writes: > > > > While trying to enhance your DUPFILE.EXW program > > > > with some additional options, I discovered what seems > > > > to be an undocumented feature of DOS under > > > > Windows 98 SE. This happens only in a DOS window, > > > > not when you restart in DOS mode. > > > > As you know, . means the current directory, and .. means the parent > > > > directory. But ... means the parent of the parent directory, > > > > .... the parent of the parent of the parent, and so on. > > > > > > That apparently doesn't work on XP. Only . and .. work. > > > > > > > So, maybe the number of possible platforms should be increased. > > > > > > I'm not sure what you mean. dupfile.exw works (more or less) on all > > > platforms. Only "." and ".." are reported by the system calls that dir() > > > uses. I guess "..." and "...." are supported artificially by the > > > Win 98 command-line processor. > > > > Which means you can write Eu code to artificially support it too, Ricardo. > > Same as adding a huge long path with create_directory(). > > > > > > Do you know why some files processed by DUPFILE.EXW when run > > > > through ex raise a "Critical error" condition? > > > > > > That's what DOS does when a DOS program tries to open a locked file. > > > Not very helpful. It will help if you close all your Windows apps > > > before scanning the whole drive with ex dupfile.exw. > > > > Even less helpful, Rob. What about checking the file attributes before any > > operations on them, Ricardo? > > > > Kat > > > > > > > >