StarBasic function FileExists("file:///tmp/test/.foo") always returns False even if .foo definitively exists. Expected behaviour: return True if file exists. Tested with LO 6.0 (Ubuntu 18.4 ppa) and 7.1 and with AOO 4.1. Works as expected with OpenOffice.
No repro Version: 7.1.4.2 / LibreOffice Community Build ID: a529a4fab45b75fefc5b6226684193eb000654f6 CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Indeed, it works with a regular dummy file URL file:///tmp/test/.foo and I must have made some mistake when testing that URL. However, my original intention was this: print fileExists("file:///tmp/test/.~lock.test.ods#") which detects a lock file for /tmp/test/test,ods when used with AOO but not LO. print fileExists("/tmp/test/.~lock.test.ods#") works with LO too. So it has something to do with URL notation vs system notation.
repro if using file name ".~lock.test.ods#" Further investigation: It seems that "#" (hash) at the end of the file name is the culprit. Whenever there is no "#" then function FileExists() works.
Created attachment 172995 [details] Spreadsheet with macro When opened in edit mode the macro detects a lock file and reports "True".
This bug report is invalid because LO is right. The correct URL of a lock file looks like file:///path/.~lock.test.ods%23 which is also accepted by AOO. AOO seems to be a little bit more generous in respect to valid URLs.
Based on Comment 5, I am marking this as NOTABUG.