FLTK logo

STR #874

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]

STR #874

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:2 - Specific to an operating system
Subsystem:Core Library
Summary:fl_filename_list filenames inconsistent
Version:1.1-current
Created By:mike
Assigned To:matt
Fix Version:1.1.7 (SVN: v4525)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 mike
06:35 May 19, 2005
Reference STR #854 for the original report.

On WIN32, fl_filename_list() returns directories with a trailing slash.

On POSIX (Linux, UNIX, OSX, etc.), fl_filename_list() returning directories *without* a trailing slash.

The current behavior is an optimization on Windows to avoid extra stat() calls in the file chooser. We could add a stat() call for the POSIX version of fl_filename_list() to add a trailing slash for directories returned in the results. This would be more consistent for the API, but might have side-effects for current users.

Thoughts and comments are welcome, we will use this STR to track the issue and document the consensus of all users.
 
 
#2 matt
01:53 Jul 16, 2005
IIRC, adding a slash inside a patth name does not harm on Unix style systems (/usr/foo == /usr//foo). But some minor issues may of course still pop up.

I do like the idea of getting around the stat call.
 
 
#3 matt
13:15 Aug 15, 2005
Are there any opinions on this? Implementing it is easy, but the code will be somewhat slower since the results from the builtin 'dirent' have to be checked via 'stat' and slashes have to be appended if needed. I personally do like the feature as it will keep me from implementing some non cross-platform stat call in 90% of the cases where I list a directory... .  
 
#4 mike
13:17 Aug 15, 2005
Since the primary consumer of the fl_filename_list() output is the file chooser, and since it must do a stat call each time it loads the list, it makes sense to put the code in one place (IIRC, the icon lookup code will use the trailing slash already...)  
 
#5 matt
15:04 Aug 17, 2005
This change is controversial. It changes the behavior of fl_filename_list
slightly by adding a forward slash after every directory name on every
supported OS. Included in this patch is a change in the code that
lists mounted volumes on OS X Mac.

Apple users, please check. Open FLUID, open the file dialog and
clear the current path. You shoudl see a list of mounted volumes.

As usual with this kind of changes, if it seems critical, I am not mad or anything if the developers decide to reverse this change ;-)
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.