Talk:File extension is in extensions list: Difference between revisions

→‎Differing definitions of 'extension': Not sure about the definition
(→‎Differing definitions of 'extension': Not sure about the definition)
 
(4 intermediate revisions by 3 users not shown)
Line 5:
: Well, the file extension has to be parsed, and there is the case of the filename not having an extension (so the requirement of having to have a file extension ... isn't).   The handling of insensitive case is a minor requirement.   It's a common enough task to warrant it's own task. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 20:28, 11 August 2014 (UTC)
 
::* Also, just to note, someSome filenames that have no file extenstionextensions:
 
::::* somefile
::::* holy smoke
Line 12 ⟶ 11:
::::* /a/path/to/glory.yup/or_not
::::* funny...
::* Some filenames that have unusual file extensions:
::::* unusual.½xy
::::* fly_in_the_ointment. imbedded_blank_after_the_period
Line 17:
-- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 20:28, 11 August 2014 (UTC)
<br> -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 19:07, 12 August 2014 (UTC) {added two more examples above.}
<br> -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:22, 13 August 2014 (UTC) {clarified headers as to what is or isn't a file extension.}
 
::I didn't read it quite right the first time and didn't see that the entire filename is an input rather than just its extension. I think it would be better to have a task for separating the file extension from the full filename without the list search task that this one is similar to. The task here is just combining two really simple tasks into an uncommon compound task. --[[User:Mwn3d|Mwn3d]] ([[User talk:Mwn3d|talk]]) 20:50, 11 August 2014 (UTC)
Line 28 ⟶ 29:
 
By the usual Unix Way of thinking, the OS and shells are largely agnostic to the notion of filename extension, so each individual program will interpret the idea as it sees fit. I see only two constraints: first, the convention that an extension must start with the final period in a filename, and second, that an extension cannot contain characters that are illegal in a filename, namely / or the null character. Other than that, it's perfectly legal to have characters like ½ or space in a filename, and the extension is no different from the rest of the filename in that regard. (Usual caveats, of course, since most filesystems haven't a clue what that you've encoded a Unicode character, and if you use spaces in an extension for your program, we will hunt you down and kill you. <tt>:)</tt> --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 00:31, 13 August 2014 (UTC)
 
: The extension ''might'' start at the ''first'' period. But let's not worry too much about that; this task has the benefit of being something that matches up with the sorts of things that many programmers want to do when starting out with a programming language. –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 13:16, 30 August 2014 (UTC)
 
== Programs violating the first sentence? ==
The first sentence of the task indicates that the extensions must include the dot. Several entries have "" in the list of extensions, which does not have a dot, and seems to indicate a desire to count filenames without extensions as if they had an extension, which I can understand, but it's technically in violation of the task. In the P6 solution I just treated extension-less files as a third option, outside the bounds of the question of whether the extension (if present) is a member of the listed extensions. Should the solutions containing "" as a putative extension be asked to fix that? Or should the task allow extensions that do not begin with "."? The latter interpretation of the task seems somewhat problematic to me. --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 00:44, 13 August 2014 (UTC)
 
:So, is a file ending in a dot a file with a null-string extension, and a file without any dot a file without an extension?
:Seems right to me. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 08:02, 13 August 2014 (UTC)
 
::I currently have it that an extension has to have at least one character after the dot, on the presumption that filenames might have punctuational dots at the end (as in the "<tt>funny...</tt>" example) that are not intended as extension dots. And that this overrides the usual desire that the degenerate case work the same as the non-degenerate case. But I don't have strong feelings either way on that. It's just the difference between a <tt>*</tt> and a <tt>+</tt> in Regexland. --[[User:TimToady|TimToady]] ([[User talk:TimToady|talk]]) 15:14, 13 August 2014 (UTC)
Anonymous user