Jump to content
FranzB

issues using filenames with spaces

Recommended Posts

I'm suffering  some strange  issue, guessing  that  the function fileexist  will  not work 100 % stable,

if I check  for  filenames  with several spaces .... 

filenamestr := 'my  report from home.csv'
if fileexists ()  then 

      begin 

      ....

      end

      else

      begin

      .....

      end;

 

on some  computers, some  folders, ...  this seems to work, other computer and folder structure  this  call fails ....

 

Share this post


Link to post
1 hour ago, FranzB said:

on some  computers, some  folders, ...  this seems to work, other computer and folder structure  this  call fails ....

Are you really using a relative path to the file?  Do you have the same problem when using an absolute path?

 

  • Like 1

Share this post


Link to post

always full path like:  

Quote

c:\temp\user data\reports\my tiny  new report.txt'

 

variation :   OS language,   Computer hardware ,...... 

Share this post


Link to post

Doesn't seem plausible. FileExists doesn't care about spaces. You'll want to do some debugging on a machine that exhibits the behaviour. 

Share this post


Link to post

Maybe there are different kinds of spaces used (like NBSC, or other from strange Unicode char , which might be seen as different characters.

Edited by Rollo62

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×