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

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

  • 103 Replies
  • 49644 Views
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #40 on: 19 / December / 2014, 14:50:27 »
Advertisements
I think this should be added to SVN for 1.4 - any objections?
None from me.
Ported :   A1200    SD940   G10    Powershot N    G16

*

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 #41 on: 19 / December / 2014, 16:42:17 »
I think this should be added to SVN for 1.4 - any objections?
Yes, no objections. So we get more test results about the limits.

msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14128
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #42 on: 19 / December / 2014, 16:47:03 »
No objection here.
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 #43 on: 19 / December / 2014, 16:53:16 »
No objections here either.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #44 on: 20 / December / 2014, 16:01:49 »
Another side effect of this change is the file browser will now show 'hidden' files in all directories.

The Canon readdir() function does not return files with the hidden attribute in sub-directories when it's operating in 8.3 mode. It has always shown them in the root directory on my cameras which support LFN in the root.

(If you use OS/X you will be familiar with the hidden files it creates that start with "._").

Should the file browser:
- hide 'hidden' files everywhere
- always show 'hidden' files
- let the user decide (config option & menu setting)

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Long filenames - a file browser modification for Select Script File menu
« Reply #45 on: 20 / December / 2014, 16:33:12 »
- hide 'hidden' files everywhere
My vote.  Not sure we need yet another menu item.  And I can't think of a use case for wanting to see hidden files on the camera.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14128
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #46 on: 20 / December / 2014, 17:28:01 »
I'd say stick to the behavior of the stock firmware for hidden files, but given the inconsistency (which probably gets worse if you include VxWorks and other DryOS revs) that doesn't help much. I would lean toward showing everything.

Another thing to think about is what shows up in the file browser vs what other callers see. For example, Lua os.listdir and os.idir.

If we are going to have menu options for lfn support or hidden file behavior, they should probably affect what the file browser shows, not what the underlying functions return everywhere in the code. OTOH, vxworks and dryos were already inconsistent so maybe having it vary randomly depending on user settings isn't so bad  ???
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #47 on: 20 / December / 2014, 17:42:40 »
I'd say stick to the behavior of the stock firmware for hidden files, but given the inconsistency (which probably gets worse if you include VxWorks and other DryOS revs) that doesn't help much. I would lean toward showing everything.

Another thing to think about is what shows up in the file browser vs what other callers see. For example, Lua os.listdir and os.idir.

If we are going to have menu options for lfn support or hidden file behavior, they should probably affect what the file browser shows, not what the underlying functions return everywhere in the code. OTOH, vxworks and dryos were already inconsistent so maybe having it vary randomly depending on user settings isn't so bad  ???

I was really only concerned with the file browser display - not suggesting the low level routines filter out anything.

The current behaviour (show hidden files in the root directory; but not in sub-directories) is a side effect of the odd choices Canon has made in the firmware.

My vote is that the file browser should be consistent in what is shows or doesn't show, and I'd agree with waterwingz that it should not display files with the 'hidden' attribute.

Not sure about the Lua functions - are there any other implications here from the LFN changes (old scripts expecting 8.3 names etc). Should the script functions default to 8.3 names unless the script requests long names? Perhaps we need some control functions to let scripts specify what readdir does (long vs 8.3 names, retrieve hidden files, etc).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Long filenames - a file browser modification for Select Script File menu
« Reply #48 on: 20 / December / 2014, 17:57:18 »
Not sure about the Lua functions - are there any other implications here from the LFN changes (old scripts expecting 8.3 names etc). Should the script functions default to 8.3 names unless the script requests long names? Perhaps we need some control functions to let scripts specify what readdir does (long vs 8.3 names, retrieve hidden files, etc).
I'd be okay with Lua scripts only using 8.3 as long as we document it that way.  However, lfn's would let you have more descriptive log file names -  yymmddhhmm.log for example. So the work to add this has some value.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Long filenames - a file browser modification for Select Script File menu
« Reply #49 on: 20 / December / 2014, 18:23:09 »
Not sure about the Lua functions - are there any other implications here from the LFN changes (old scripts expecting 8.3 names etc). Should the script functions default to 8.3 names unless the script requests long names? Perhaps we need some control functions to let scripts specify what readdir does (long vs 8.3 names, retrieve hidden files, etc).
I'd be okay with Lua scripts only using 8.3 as long as we document it that way.  However, lfn's would let you have more descriptive log file names -  yymmddhhmm.log for example. So the work to add this has some value.

I'm not sure any extra work is required for LFN in Lua - os.listdir calls opendir/readdir so they should now see long names everywhere.

It's only if we want to allow the script to control what it sees (force 8.3 names, don't return hidden files, etc), that changes may be needed.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal