Re: path problem

*To*: mathgroup at smc.vnet.net*Subject*: [mg32404] Re: path problem*From*: bghiggins at ucdavis.edu (Brian Higgins)*Date*: Sat, 19 Jan 2002 01:16:40 -0500 (EST)*References*: <a28bjs$h51$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

You can use SetDirectory. But of course you still have to give the path. A method that I find very useful especially if I am working with different operating systems is to use the experimental function called FileBrowse:. Suppose I have a notebook open and I need to read some data from a file buried deep in one of my folders. I type in and evaluate Experimental`FileBrowse[False] You are then present with a dialog box that allows you to browse for a file. Once you have found the file select Open and a string representing the path to that file is pasted into the Notebook. I can then copy that string into the required function e.g. Get or Read etc. If I want to set the directory for a particular file I can paste the path with the file name deleted into SetDirectory. I find this function very handy and helpful for teaching students to read files into Mathematica no matter what operating system they are familiar with. Cheers, Brian isLi-Xin Li <lli at fas.harvard.edu> wrote in message news:<a28bjs$h51$1 at smc.vnet.net>... > Hi, > > I have just installed a mathematica 4.1 on my PC under dos/windows. > When I try to run a program, it turns out that mathematica cannot find > the files in the current directory (the . directory). When I check > the $Path from mathematica, I find that "." is in the list of paths. > Could somebody teach me why mathematica cannot find the file in the > directory (e.g., when I try "<<a.m" mathematica told me "Cannot open > the file") and how to fix it? Do I have to type the long string for > the path of the file each time? Is there a way to configure mathematica > so that it can find files in the current directory? > > Thanks, > L.X.Li