Recent

Author Topic: Interesting problem with Filelistbox  (Read 13209 times)

liewald

  • Full Member
  • ***
  • Posts: 142
Interesting problem with Filelistbox
« on: July 10, 2012, 03:18:26 pm »
Lazarus 0.9.30.4 r35971 FPC 2.6.0 x86_64-linux-gtk 2

I've  written a little prog that uses a directory edit to select a dir with the onchange event triggering an update on a filelistbox to populate it with the contents of the directory.

When running againt the a local dir it works perfectly but if I point it at a samba mounted dir on my system it drops dir entries anout 15% of them.

Pain in the butt. Had to copy sime massive datasets to the local machine to get the program to work!

TheBlackSheep

  • Jr. Member
  • **
  • Posts: 93
Re: Interesting problem with Filelistbox
« Reply #1 on: July 10, 2012, 03:44:39 pm »
I usually use the function;

function FindAllFiles(const SearchPath: String; SearchMask: String = '';
  SearchSubDirs: Boolean = True): TStringList; 

in the FileUtil unit. 

It creates a TStringList (i.e. you don't need to create first although you will need to free it once you're finished) - I never liked the Delphi filelistbox (looked so Win3.11)  - you can just populate a listbox from it if you need to see the list - if not just manipulate the files from the list and free it.

TheBlackSheep

liewald

  • Full Member
  • ***
  • Posts: 142
Re: Interesting problem with Filelistbox
« Reply #2 on: July 12, 2012, 10:51:16 am »
Yup thats what I usually do. I was just remarking on the funny behaviour of the component in this situation.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Interesting problem with Filelistbox
« Reply #3 on: July 12, 2012, 11:31:59 am »
Would you have the remote operating system/samba version

Does it drop all directory entries 15% of the time or 15% of the entries all of the time? I suppose the latter, right?

A sample program always helps when testing: in determining whether this applies to all remote systems (i.e. samba or also Windows hosts), perhaps pinpoint Lazarus/samba versions, etc.

Does the attached program show the errors?

Lazarus 1.1 (trunk), r37399, FPC 2.6.1 x86, Windows x64 Vista: works against a Debian Samba 3.5.6~dfsg-3squeeze8 (x64) with 25 files, 96, and 2001 files in a directory
(Tested the 2001 files by clearing the directory edit, pasing the directory again for a large number of times. Number of files always shows 2001)

Thanks,
BigChimp
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: Interesting problem with Filelistbox
« Reply #4 on: July 12, 2012, 06:09:06 pm »
Could it be that the files your not seeing are hidden/system files, but you have view hidden/system files in Explorer?

As default the FileListBox FileType property has ftSystem/ftDirectory/ftHidden/ftArchive set to false.
Maybe set everything to true and see if it shows everything.

liewald

  • Full Member
  • ***
  • Posts: 142
Re: Interesting problem with Filelistbox
« Reply #5 on: July 13, 2012, 11:50:32 am »
OK BigChimp

here we go. The datasource is actually a 20GB Synology NAS box serving as a windows file server. and connected to using the samba client.

(http://www.synology.com)

It drops the same entries all of the time about 15% of them

Yup the program dropped 3 of 22 files in the directory - Should be numbered sequentially 1 - 22

all of the standard linux command read the dir fine

Kpjcomp : everything set to true and when the files copied off the network to a local drive works fine

liewald

  • Full Member
  • ***
  • Posts: 142
Re: Interesting problem with Filelistbox
« Reply #6 on: July 13, 2012, 12:00:16 pm »
Forgot here's the prog running against a local dir ( And I know I'm logged in as root!!!!)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Interesting problem with Filelistbox
« Reply #7 on: July 13, 2012, 12:02:00 pm »
Ok, no more ideas from my side except edit: checking for an existing bug report and filing a bug report with the test program and your other details (Lazarus 0.9.30.4 r35971 FPC 2.6.0 x86_64-linux-gtk 2) which also specifies: samba client version used, if possible samba server version and/or Synology model number.

If you could test the NAS from a Windows machine and confirm/deny behaviour that would make troubleshooting even easier.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

liewald

  • Full Member
  • ***
  • Posts: 142
Re: Interesting problem with Filelistbox
« Reply #8 on: July 13, 2012, 12:08:12 pm »
Willdo

liewald

  • Full Member
  • ***
  • Posts: 142
Re: Interesting problem with Filelistbox
« Reply #9 on: July 13, 2012, 12:31:14 pm »
Worked fine in win64.

Raised bugreport!

Dave

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Interesting problem with Filelistbox
« Reply #10 on: July 13, 2012, 12:43:20 pm »
Thanks Dave. One thing I forgot: you're using an old Lazarus/FPC version... perhaps there was a bug that was fixed since, so you might want to test with an SVN Laz version+say SVN FPC 2.6.1... if you have it...

Edit: noticed you didn't upload the test program. Might be a good idea to do so - and I think you modified your version, so I'm hesitant to upload mine...
Also, you didn't mention Synology version/firmware version and/or samba server version, which might be handy for comparison/determining root cause...

Edit2: interesting that the same files always get dropped. Can you determine some pattern? E.g. last in a ls output, size, name characteristics?
« Last Edit: July 13, 2012, 12:47:15 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

liewald

  • Full Member
  • ***
  • Posts: 142
Re: Interesting problem with Filelistbox
« Reply #11 on: July 13, 2012, 12:49:20 pm »
Still having probs getting 2.6.1 to install on 64 bit linux but working on it

D

Bart

  • Hero Member
  • *****
  • Posts: 5288
    • Bart en Mariska's Webstek
Re: Interesting problem with Filelistbox
« Reply #12 on: October 13, 2012, 04:10:53 pm »
@liewald: please answer my question in bugtracker.
If you do not give feedback there, the issue will be closed as "unable to reproduce".

Bart

Zittergie

  • Full Member
  • ***
  • Posts: 114
    • XiX Music Player
Re: Interesting problem with Filelistbox
« Reply #13 on: February 03, 2013, 04:25:05 pm »
Did you find a solution for this problem?

I have the same error.

Using Netgear Readynas share FINDALLFILES only finds 6303 files while there are more than 9000 files.
Local access finds all files.

I am using Lazarus v1.1 on Linux Mint & Lazarus 0.9.30.x on Raspberry Pi (ARM Linux).  Both giving the same result.
Same files are filtered out.  All Files have same users and permissions
Be the difference that makes a difference

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Interesting problem with Filelistbox
« Reply #14 on: February 03, 2013, 04:32:47 pm »
See the bugtracker issue. AFAIR, it's a bug in Samba, not FPC.

Edit: mmm, Dave Liewald didn't even post a link to the bugtracker. Here is his original report:
http://bugs.freepascal.org/view.php?id=22423
... which is linked to this bug:
http://bugs.freepascal.org/view.php?id=23732
see comment
http://bugs.freepascal.org/view.php?id=23732#c65140
for a link to the samba bug:
https://bugzilla.samba.org/show_bug.cgi?id=8044
« Last Edit: February 03, 2013, 04:37:09 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018