Recent

Author Topic: Existing files do not FileExistsUTF8 ...  (Read 1774 times)

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Existing files do not FileExistsUTF8 ...
« on: September 23, 2019, 06:39:54 pm »
having problems with existing files not being found.
Found this:
https://forum.lazarus.freepascal.org/index.php?topic=36759.0

Wonder if the "use fileutil instead of lazfileutil" advice, also is valid for the other ...UTF8 methods?
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

winni

  • Hero Member
  • *****
  • Posts: 3197

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: Existing files do not FileExistsUTF8 ...
« Reply #2 on: September 23, 2019, 07:37:30 pm »
Well - that's kind of the thread I'm referring to.
It doesn't answer my question.

FileUtil.FileExists() does not find some of my files either....

Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Existing files do not FileExistsUTF8 ...
« Reply #3 on: September 23, 2019, 07:39:27 pm »
Can you paste in some of the not-found file names here?

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: Existing files do not FileExistsUTF8 ...
« Reply #4 on: September 23, 2019, 07:57:18 pm »
I can give you an example... ;)

'\\NETLAGER\F\NAS\Foto\Knuth\2019\04April\2019 04 24\20190424_171636.jpg'

They are all pictures, and they are all named yyymmdd_hhmmss.jpg - all numers adn underline - with ext jpg

Some are found, and some are not.

Been running this test a couple of times now.
All files already exist (according to Windows Explorer).
If the file is not found, it is copied.
And it seems, the next time, it will find the files, the program has created itself - even if there is no difference in filename.
(Copying overwrites existing files - on purpose)
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Existing files do not FileExistsUTF8 ...
« Reply #5 on: September 23, 2019, 11:08:08 pm »
Are you using WHITES spaces in your source file names?
The only true wisdom is knowing you know nothing

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: Existing files do not FileExistsUTF8 ...
« Reply #6 on: September 23, 2019, 11:21:04 pm »
Not in filenames, but there are in folder names.
Doesn't seem to be the problem tho.
Many of the files, that ARE found, are in folders with whitespaces.

Can say, the reason I used the UTF8 - versions, were, that I also use danish characters (ÆØÅæøå) in folder names. There are no problems with that either.
I have changed to the regular files versions from FileUtil - and it seems to make no difference.
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: Existing files do not FileExistsUTF8 ...
« Reply #7 on: September 23, 2019, 11:36:24 pm »
Problem solved.
I was looking the wrong place. The files that can not be found, isn't there.

Sorry.

The original question - if all the other ... UTF8 functions in LazFileUtil can be replaced by their FileUtil versions, seems to be yes.
I have done it, and it does not create any problems, with UTF8 (at least folder-)names.
Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Existing files do not FileExistsUTF8 ...
« Reply #8 on: September 23, 2019, 11:37:00 pm »
When I see the path in the filename a NAS appears.

So, is this a remote NAS?
And what kind of filesystem is used?

Maybe there is the fault?

In (very) old Delphi times I had problems with drives from a Netware Server concernig fileExists.

Winni

Birger52

  • Sr. Member
  • ****
  • Posts: 309
Re: Existing files do not FileExistsUTF8 ...
« Reply #9 on: September 24, 2019, 09:16:53 am »
Not a real NAS.
Had one that faulted, so had to move it all somewhere else, until I get another.
This is also why, I looked the wrong place for the files - at the moment, I have everything the same place, with almost the same folder names.

Lazarus 2.0.8 FPC 3.0.4
Win7 64bit
Playing and learning - strictly for my own pleasure.

 

TinyPortal © 2005-2018