Long filenames - a file browser modification for Select Script File menu - page 3 - General Discussion and Assistance - CHDK Forum

Long filenames - a file browser modification for Select Script File menu

  • 103 Replies
  • 48376 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #20 on: 11 / December / 2014, 16:10:41 »
Advertisements
- does the buffer for reading the directory in chdk-dir.c need to be 16K (seems a bit big)?
No, I used a much smaller size for testing. If the directory happens to be large, reading small amounts from the card may slow things down a bit. The Canon functions use a 32kB buffer by default (and more than twice as much in worst case).

I have tested a non conform filename with German special chars. The file name is displayed in the 8.3 format as described. In this case on the SX220 no file size is displayed => ? ? ?.
Did the same (on Linux), got the same unreadable file name on camera with and without the LFN parser. ??? means that stat() could not find the file. Since the camera (without CHDK) only writes files with English letters + numbers, I'm not sure how international characters in filenames are treated.

Quote
A small cosmetic thing in gui_fselect.c: "<UpDir>" has 7 chars. Maybe "<Up>" is better for the new width of 6 chars.
I have done this in the attached v4 patch. I have also implemented the switch I mentioned earlier ("Disable long filename support" in the Misc menu).

@WW
That is best discussed in a separate thread, I guess.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #21 on: 12 / December / 2014, 09:23:26 »
I have also implemented the switch I mentioned earlier ("Disable long filename support" in the Misc menu)
This does not work for me, also after deleting of the core config file. It will still be displayed long file names.

msl
CHDK-DE:  CHDK-DE links

*

Offline srsa_4c

  • ******
  • 4451
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #22 on: 12 / December / 2014, 11:19:25 »
I have also implemented the switch I mentioned earlier ("Disable long filename support" in the Misc menu)
This does not work for me, also after deleting of the core config file. It will still be displayed long file names.
Which camera is that?
The name of the menu option is a bit misleading (the whole explanation does not fit there): it only controls the built-in LFN parser. If the option is enabled, only the firmware routine will be used. The firmware routine of newer cameras can return long filenames in the following cases:
- card is exFAT
- card is FAT12 or FAT16 (LFN only returned in the root directory)
I have tried it on my a3200 which is a "newer" camera.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #23 on: 12 / December / 2014, 14:38:08 »
Ah ok, then I have misunderstood the menu item. It works as described on the SX220.

It is difficult to find a short explaining term for this menu item, perhaps 'alternative long filename support'.

The menu entry should be included only on the affected cameras. For that we need an additional definition in platform_camera.h  (CAM_DRYOS_2_3_R43   ? ? ?).

msl
CHDK-DE:  CHDK-DE links

*

Offline srsa_4c

  • ******
  • 4451
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #24 on: 12 / December / 2014, 18:43:43 »
The menu entry should be included only on the affected cameras.
All DryOS cameras are affected. I expect most CHDK users to use FAT32 / FAT16 cards due to autoboot, the firmware routines will only show long filenames on FAT16 cards, and only in the card root. CHDK files with long names are only found within the CHDK directory, so firmware routines won't ever show those long names.
Those few users who use exFAT cards will never see short filenames, regardless of what they choose.
Still not sure how to name the option.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #25 on: 13 / December / 2014, 04:51:02 »
Thanks for the summary. I hope I understand it now right.

The support of long file names should be absolutely part of the CHDK 1.3 release. This would be a very nice christmas gift for all CHDK users.  :xmas

msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14126
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #26 on: 13 / December / 2014, 15:47:11 »
The support of long file names should be absolutely part of the CHDK 1.3 release. This would be a very nice christmas gift for all CHDK users.  :xmas
I understand this is a very nice feature, but I really don't think it is a good idea to put in a major experimental change like this into the release at the last minute.

If it proves to be stable, backporting in a month or two could be ok.
Don't forget what the H stands for.

*

Offline eponymous

  • *
  • 38
  • Canon A4000
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #27 on: 14 / December / 2014, 13:22:12 »
The support of long file names should be absolutely part of the CHDK 1.3 release. This would be a very nice christmas gift for all CHDK users.  :xmas
I understand this is a very nice feature, but I really don't think it is a good idea to put in a major experimental change like this into the release at the last minute.

If it proves to be stable, backporting in a month or two could be ok.

Isn't it better practice to do a new release with a new number? (Or do I misunderstand "back porting"?)
John

*

Offline reyalp

  • ******
  • 14126
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #28 on: 14 / December / 2014, 15:18:34 »
Isn't it better practice to do a new release with a new number? (Or do I misunderstand "back porting"?)
Off topic:
Sure, we could call it CHDK 1.3.1. The point is that there should be some time to check for potential side effects before it goes in the stable release. If the feature proves stable and is isolated enough, it could be moved to the "stable" branch without releasing everything in the dev branch.

On topic:
One thing we should think about is how this interacts with scripting, the results of os.listdir / os.idir are presumably changed. This will also affect PTP clients.

There are also some extreme path name limitations on some cameras (DryOS r39 and later IIRC). If you put an LFN in say CHDK/SCRIPTS/EXAM does it still work?
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #29 on: 14 / December / 2014, 17:11:09 »
One thing we should think about is how this interacts with scripting, the results of os.listdir / os.idir are presumably changed.
Since scripts can now switch LFN support on/off, it should be possible to write scripts for testing various effects.

Quote
There are also some extreme path name limitations on some cameras (DryOS r39 and later IIRC). If you put an LFN in say CHDK/SCRIPTS/EXAM does it still work?
If there are indeed such limitations, do they affect FAT/exFAT users the same way (exFAT only supports long filenames)? Should opendir check for path length?

 

Related Topics


SimplePortal © 2008-2014, SimplePortal