While trying to check code for file found/file not found,
I encountered that FILES for
returns data for
First I thought that to be a bug in FILES,
but I saw that C# behaves same way.
After some googling it seems that file name ending with a dot is invalid in Windows - so Windows silently strips final dots.
Here's the code proving that (tested on WinXP SP3. Google says problem manifests in Win7, and I think in lates Windows too.
I really find this amusing.
'code shows that for Windows,
'are the same thing
'(tsh73 Nov 2017, tested on XP SP3)
'fileName$="data.txt..." 'creates "data.txt", no extra dots
'create data file
open fileName$ for output as #1
print #1, "data goes here"
fileName$ = fileName$+"....................." 'opens "data.txt", extra dots are ignored
print "Time stamp for a file ";fileName$
files DefaultDir$, fileName$, info$()
if info$(0, 0) = "0" then
getFileStamp$ = "File not found"
getFileStamp$ = info$(1, 2)