Re: OpenRead crashes System 7
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: OpenRead crashes System 7
- From: withoff
- Date: Tue, 23 Nov 93 16:08:53 CST
> Dear MathGroupers: > I have just found a way to crash Macintosh System 7.1 with the Mma 2.2.1 > operator OpenRead. It's not much fun, but here are detailed instructions > for those who might like to try it: > > 1. Use FileNames["*xxx*",$Path,Infinity] to locate all files in your home > directory that have xxx anywhere in their name. (I assume $Path still has > its automatically initialized value). > > 2. Use control-t to unformat the return, and copy out the desired > pathname, including its surrounding quote marks. If it is long enough to > have a line continuation in it, take out the \, the carriage return(s), and > any extraneous spaces. Paste it on the right in > > dataPath = "<<path from current directory to desired file>>" > > 3. Verify dataPath with FileDate[dataPath]. When you have the dataPath > correct, the date of last alteration of your data file be returned. > > 4. Now issue OpenRead[dataPath]. Mma will go into a seemingly endless > loop, it will not abort, the cursor will be dead or disabled, and all you > can do is hit the reset button. > > OpenRead["fileNameOnly] does work if you do one of the following: > > (1) Prepend to $Path the path to the directory that directly contains the > desired file, or > > (2) Use SetDirectory to change the current directory to the subdirectory > that directly contains the desired file. (I find this awkward, since > SetDirectory seems to work only one level at a time. Even DOS did better > than that! But this is a separate complaint...). > > Regards- Martin I'm afraid I wasn't able to duplicate any of this. The functions involved quite quickly call Macintosh system and C library functions, and the only known problems are related to differences in file naming conventions. I have a hard time imagining how this could crash a computer unless the system or the C library or the file being opened is somehow messed up. SetDirectory also worked fine when I tried things like SetDirectory[":Packages:Statistics:Common"] (or whatever the proper Macintosh pathname separator convention is). This sounds like a question that could be sent to our technical support department (support at wri.com). Dave Withoff Research and Development Wolfram Research