Home computer use: a directory surprise

Self-tutoring about home computer use: the tutor mentions a non-literal file path.

Windows is amazing for some things, but since it tries to be everything to everybody, it faces some challenges. I stumbled upon one such yesterday.

For test purposes, I wanted a program to write to, then read from, a file — let’s call it file0.txt. I wanted file0.txt by itself, so it would be easy to find again. Browsing for a good place, I found the folder “Public Documents”, which I never use, so was empty. Therefore, I decided to put file0.txt in there.

I sent the program to write to “C:\dir\dir\Public\Public Documents\file0.txt”, but was told there was a problem: “that file path doesn’t exist.” I double-checked, of course, but found it does exist, according to the File Explorer.

Yet, the File Explorer doesn’t always see things the way the Command Prompt does. Therefore, I opened it to check its opinion.

The Command Prompt reported the “C:\dir\dir\Public\Documents” directory, which is where I found the file0.txt. There isn’t a “C:\dir\dir\Public\Public Documents” directory, according the the Command Prompt. I’ve noticed the same situation on another Windows 10 computer.

I changed the file path in the program to what the Command Prompt says, and it works fine. From the software’s point of view, perhaps, the Command Prompt’s rendition of the directory structure is literal, while the File Explorer’s may not be.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply