Re: FileManipulation
- To: mathgroup at smc.vnet.net
- Subject: [mg15060] Re: FileManipulation
- From: "Dale Horton" <daleh>
- Date: Wed, 9 Dec 1998 04:12:39 -0500
- Organization: Wolfram Research, Inc.
- References: <7430ql$n01@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
It appears to be related to $HomeDirectory. In[1]:= FileNames["*",{$HomeDirectory}] has "\\\\" In[2]:= FileNames["*",{$TopDirectory}] has "\\" -Dale Jason Gill wrote in message <7430ql$n01 at smc.vnet.net>... >I encountered an interesting behavior running 3.1 on Win 95. When using >the functions filenames to generate a list of files and then attempting >to use that list within a function results in a "out to lunch error". > The example I am using is >In: >all = FileNames[*,$HomeDirectory,1]; Out: >{c:\\95drive,c:\\autoexec.bat, etc.} However attempting to > >Map[FileType,all] > >sends the kernel out never to return. > >On futher investigation, >In: >FullForm[all[[1]]] >Out: >"c:\\\\95drive" > >It appears that Mathematica perpetually adds backslashes. That is if I >take the a original version of "all" and manually stirp away the second >backslash, Mapping FileType works as expected. I am not sure what is >causing this behavior, or how to correct it without manually removing >the extra backslash in FileNames. > >I suspect I am not describing the problem very clearly, but the problem >is based on an example Given in the Mathematica book, page 15, where I >have substituted FileType for FileByteCount. > >Anyways, It is not a very critical application, I was just wondering if >anyone else has encountered it, or more importantly why is it doing it? > >Thanks, >Jason > > >