[plt-scheme] with-input-from-file

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Tue Mar 9 06:47:28 EST 2010

On Mar 9, 2010, at 6:39 AM, Noel Welsh wrote:

> On Tue, Mar 9, 2010 at 11:27 AM, wooks . <wookiz at hotmail.com> wrote:
>> Ah hah...... understood what I was supposed to do now. (directory-list) is
>> calling the file numbers.txt.txt ......
>> thats not what the file is called. It's put an extra .txt suffix on it.
> I haven't used Windows on a regular basis for about 8 years, but when
> I did use it there was an option to hide file suffixes. My guess is
> this option still exists and you have this option turned on. Try this
> (rename-file-or-directory "numbers.txt.txt" "numbers.txt")
> and see what happens. If Explorer (or whatever the Windows file system
> viewer is called these days) shows the file as just numbers then we've
> found the problem.

I would put money on that.  (directory-list) is telling you the file's REAL name, and (with-input-from-file...) is looking for it by its REAL name.  Windows Explorer is hiding part of the name from you.  When I sit down at a Windows machine, one of the first things I do is uncheck the "Hide suffixes for known filetypes" option so I can see what my files are really named.

Stephen Bloch
sbloch at adelphi.edu

Posted on the users mailing list.