FLTK logo

Re: [fltk.general] Concerns regarding fl_filename_ext()

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 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Concerns regarding fl_filename_ext() Bill Spitzak Apr 24, 2021  
 
The behavior with /.hidden could probably be changed to match Unix conventions. Look for the last period that is at least 2 places beyond the last slash.


On Sat, Apr 24, 2021 at 11:47 AM lifeatt...@gmail.com <lifeattickville@gmail.com> wrote:
I've run into two issues with fl_filename_ext(). Using the latest github FLTK and Linux.

First, the documentation says the function returns NULL if there is no "last period". In fact, I've found the function returns the empty string in that case:

  out = fl_filename_ext("/some/path/foo/");
  assert(out != 0);
  assert(strlen(out) == 0);
     
  out = fl_filename_ext("/some/path/foo");
  assert(out != 0);
  assert(strlen(out) == 0);

This appears to be day-zero behavior, so a minor tweak to the documentation should be all that is required.

Second, how is a hidden file/folder expected to be handled? E.g.

  out = fl_filename_ext("/some/path/foo/.hidden");

will return the string ".hidden", whereas I consider the path to not have an extension.

Any thoughts?
Kevin

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/d07d812f-0830-4d20-ac6a-8522afec9ff9n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAL-8oAjJjnnm%3Dt%3DmFUOfW8k4WN1jSXGs-SdfiAPG%3DR6E4h1zWw%40mail.gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

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'.