|
Post by xxgeek on Oct 20, 2021 21:21:18 GMT
Just ran across an issue that may help others in future coding maybe right now.
If a file is asked to opened/read(or written), and there is a Folder of the same name in the same folder as the file in question then there will be an error 55 - "can't find file"
So, if you're naming your files and or your folders, use different names if they reside in the same folder.
Hard one to track down, but persistence paid off. Once I deleted the folder of same name, all went well. I'll either name that folder something else now, or not use it at all.
If this has been posted before, it needs repeated. I've read every post in these forums and either missed it, or forgot about it.
Is it a bug in Just Basic? I don't know. Win 10 Pro
To prove it for yourself run the code then run it again after commenting out the line res = mkdir("Hello") and deleting the folder it created on first run.
I understand files use extensions, but extensions are not a necessity.
res = mkdir("Hello") open "Hello" for output as #1 close #1 end
|
|
|
Post by tsh73 on Oct 20, 2021 21:44:39 GMT
just tested in Explorer Windows 7 Windows just do not let rename file to match folder or folder to match a file.
Probably not a bug but Windows feature, "by design".
|
|
|
Post by xxgeek on Oct 20, 2021 22:56:11 GMT
Probably not a bug but Windows feature, "by design". You are correct, and Linux as well. Didn't expect that from Linux, as filenames in Linux can have multiple same names, as long as they use differing case. eg: Hello, hello, HellO, HeLLo, HEllO, heLlO can all reside in the same dir in Linux. Windows however doesn't take case into consideration. eg: Hello would (to windows) be the same as hello Since JB is running in a "Windows" environment re - WINE it follows the Windows design, and if you run open "Hello" for output as #1 close #1
open "hello" for output as #1 close #1 end
The second file overwrites the first. However if you're working in the Linux FileManager you can write both those files in the same dir (Hello, and hello) without issue. Strange I don't recall ever running across this in 40 years. It is possible I did come across this and have from then on avoided the issue, and since it was so long ago then forgot why I never name folders the same as a file in the same dir. (Until today) Good catch tsh73 Once I fixed the problem (by renaming the folder) I didn't look into it any further
|
|