Short Names

  • Chris Harshman - Monday, July 17, 2017 12:07 PM

    Sinisa Jazic - Monday, July 17, 2017 9:42 AM

    If I could talk to an OS (HAL 9000) then I would refer to a file by any name I like.

    LOL I can see it now... "Open up that file that I was working on Friday that had that weird stuff in it with those numbers that didn't balance right"

    Exactly.
    ;^)

  • Jeff Moden - Monday, July 17, 2017 9:17 AM

    I'd just like to see people start using their heads when naming directories and how they structure directories.  For example, having monthly directories stored as MMMYYYY is insane.  It defies sorting, which is especially important when trying to find directories that can be dropped due to age.  You might thing the created date would be enough until you realize that someone creates a whole year of directories at a time.

    That's why we  use YYYY_MM with the MM being the number of the month. So you have folder 2017_07 and such, everything is easy to sort chronologically...

  • patrickmcginnis59 10839 - Monday, July 17, 2017 12:05 PM

    bmg002 - Monday, July 17, 2017 11:22 AM

    Jeff Moden - Monday, July 17, 2017 10:48 AM

    Sinisa Jazic - Monday, July 17, 2017 9:42 AM

    Why are we still typing? Umm, it's 2017, not 1817.  If I could talk to an OS (HAL 9000) then I would refer to a file by any name I like.  But, as long computers continue to use a 200-year-old input interface, I will continue to type the shortest filename that I can think of. Bah, humbug.

    BWAAAA-HAAAAA!!!!  If most people could talk to an OS, the OS would get confused and self destruct! 😉

    I don't know how often my car misinterprets what I am saying...
    me - "What is playing?"
    car - silence
    me (becoming impatient) - "cancel"
    car - "calling home"

    I'd have sooooo many poorly named files and folders if I could talk to my computer... Or I'd be accidentally formatting my disk every day.  
    me - "Rename folder pics to pictures"
    computer - "format C:\ /autotest?"
    me - "NO!"
    computer - "formatting C:\ /autotest"

    But, going back to the OP, I like the linux system where each file has a specific header that identifies the file type.  You can call your image "thisis.dumb" and it can see that the header (the "magic number") says it is a jpg and it'll open with your jpg viewer.  Now, I also see how this can easily get messy as you could create an exe (or equivalent), give it the mspaint logo and call it "awesome.jpg" and users would double click on it not realizing it is an executable.  linux gets around this with the executable flag on a file, but that would require re-writing the FAT/NTFS file structure.  So, I think there is no universal solution to the problem.  Windows aims at being user friendly and doesn't care about file content when looking at what should open a file; simply looks at the extention.
    As for the auto-complete that was suggested, that is already implemented from my understanding.  Which tool is missing it?  From what I can see, CMD has it, powershell has it and any application that uses a folderpicker object has it.

    Something to note - if I am not mistaken, the file/folder character limit is a limit imposed by the file allocation table on the FAT and NTFS filesystems, not on the OS.  A windows formatted disk (FAT32 or NTFS) read on a Linux OS will still have the same limitations.  It is the same problem with FAT32 and large files (larger than 4 GB).  NTFS and exFAT got around that and there were some tweaks you could do to FAT32, but they were unsupported and could result in disk corruption and thus were not recommended.

    Also, in the event that you have a file/folder path that is too long, you can use symbolic links and/or junctions to shorten the path.  I had that issue at one point, so now I have the folder C:\pf that points to C:\program files and that helped shorten things up nicely.

    And to comment on djackson 22568's arguments against Windows; the reason that Windows hides file extensions by default is that the average end user doesn't care about the extentions.  Windows is aimed at being "user friendly" and most non-technical end users don't like seeing "solitare.lnk" on their desktops or any of the default hidden files.  The average Windows user likes things to look uncluttered.  And as for your claim that Microsoft refuses to fix security flaws, you should look at their monthly patches that they release.  Majority of these are security related bug fixes.  And before you say that Microsoft is slow at fixing their bugs, remember that a Linux kernel bug that was in the kernel for over 10 years was found and fixed this year.  When bugs get reported, they generally get fixed quickly based on the severity of the bug.  A bug in solitare for example that allows you to cheat at the game and win would be low priority.  A security flaw in NTLM that allows for administrative access during the failover from Kerberos to NTLM authentication; that gets fixed quickly.
    No piece of software is bug free unless the software is so trivial that bugs are not possible.  Heck, even notepad had a bug on older systems - https://en.wikipedia.org/wiki/Bush_hid_the_facts.  This was patched in Windows 7 I believe and hasn't persisted to windows 8, 8.1 or 10.
    iPhones have bugs, android phones have bugs, linux has bugs, MAC OS has bugs... pretty much every system has bugs.  If you can find an OS that has no bugs in it, the OS is very trivial OR there is no benefit in finding and fixing the bugs.

    I think its more about the relative number of occurrences that we're commenting on. For example, I like how Mr. Daniel Bernstein guarantees his programming against "security holes" which we could consider as bugs, granted he's not writing operating systems, but still with internet facing daemons secure software really goes a long ways, and the guy literally pays $1k bug bounties out of his pocket. As a counter example, Lennart Poettering, of Redhat's systemd project is writing software in such a way that its becoming a large monolith of tightly coupled logic that increasingly is replacing better known software systems and its becoming a source of poorly understood bugs, its getting so bad that folks are bailing to the BSD's and Lennart actually gets death threats. Think about this, when is the last time a consumer of your programming efforts have sent you death threats because of your actions?

    If you haven't heard of the gianourmous flame war that took place when systemd started getting adopted by Linux distributions you should check it out, I've been putzing around with Linux for quite some years now and I've never seen anything like it.

    Check out the below link, one of my favorite systemd "not a bug" arguments, pay close attention to the fact that this will not get fixed.

    https://news.ycombinator.com/item?id=14682210
    (mistakes in usernames result in root privileges, but will not be fixed because "not a bug" )

    I had not read that, but it was a fun read.  I do agree though, if you properly document a potential problem with your code and users choose to ignore it, then it is not a bug.  In this case, it is a restriction in what is a valid first character for a username.  It is documented that it needs to start with a lower case letter.  Now, how that is handled to me sounds like a bug - it should just prevent the user from being created and that'd be easy to do in the useradd function, but death threats seem a bit harsh for that.  I imagine part of the problem here is the "spoiled brats" (as I so lovingly call them) who think that the universe and everyone in it owes them something.  "I'm using your free OS and there is this bug in it.  You MUST fix it for me now or else" type attitude.  A lot of freeware application developers (OS or otherwise), do it as a hobby.  I'm not sure if you have ever wandered through the ROM development threads over on the XDA forums, but there are a lot of people who post things like "When is the next release coming out?" "It's been 2 weeks, can we get an ETA when this bug will be fixed?" etc and the developers end up just dropping the project.

    I've worked on some freeware tools (I helped work on a bug ages ago in the Playstation 2 era where its DOS like system had a bug when running scripts) and I had a few people appreciate what I had changed, and then started getting a lot of PM's telling me to add features or implement some fixes.  Never got death threats, but did get accused of trying to steal another guys work even though I had given him full credit for his original work, followed all of the rules for making changes to his code and making it public, and released full source for what I had done.  I left that community as it became far too toxic.

    I think that one of the major reasons that Windows gets the biggest notice for having the "most security flaws" is because of its large user base and thus large target base for hackers.  Plus the bragging rights you get for finding a hack you can perform on a closed-source application.  The good hackers find the security flaw, report it to the developer with examples of how to exploit it and work with the software developer to get things patched.  The bad ones sell it online.  The bad software developers attack the guy who found the flaw instead of working with their team to patch it.  I remember reading quite a while back about a guy who found a flaw in facebook where you could add people as friends and bypass the requirement for them to add you back.   He reported the bug hoping to get the bounty Facebook offered and they told him that it wasn't a bug and they couldn't reproduce it.  He then demonstrated that it worked by adding Mark Zuckerberg as a friend and posting on his wall and ended up having his account banned for it.
    Now, is that story true?  I'm not 100% sure.  I didn't know the guy nor see his account or his hack, but it was something I read a while back... unfortunately I cannot find any link to the story so I'm starting to wonder if it was true or not...

    The other reason windows security flaws are so popular is that they get the most notice from the internet.  Linux bugs have a much smaller community to complain to, and a lot of users who find linux bugs are more likely to offer patches to them than exploits.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • chrisn-585491 - Monday, July 17, 2017 6:30 AM

    If you spend some time studying and working in various other operating systems and file systems, this is not a trivial problem. There are solutions, but they would require retooling of countless utilities and such and the current file systems are too entrenched.

    I personally think we should redo TSQL so it reads like Objective C or Smalltalk, the keywords are too short and not descriptive enough... 😛

    And structured poorly. CREATE TABLE v ALTER TABLE.

  • ken.romero - Monday, July 17, 2017 7:05 AM

    You say developers are lazy like it's a bad thing! Yeah, we're so lazy that it never occurred to any of us that we should totally re-engineer a longstanding and perfectly workable system that everyone knows. Spaces are allowed in the filenames but they don't work in all applications and situations; so I still see lots of files named things like This.Is.The.File.Name.txt. To me, knowing that the last three characters are the extension is great and I much prefer that to This.Is.The.File.Name.FileType. Does that file have an extension on it? Is "FileType" the name of the extension or were they trying to name the file and accidentally hit enter before they got to the end? If they extension could be anything there's no way to know!

    So in short, longer more descriptive file names would be useful for none technical folks like my Mom, but she doesn't even show extensions in the names anyways. It would be a lot harder for people who actually use extensions if we just obliterated all the conventions around them that we're used to.

    I didn't say re-engineer anything. Just that we allow longer names, so why is .mdmp or hdmp used for new extensions. At least use .mindmp or .fildmp.

  • Jeff Moden - Monday, July 17, 2017 9:17 AM

    I'd just like to see people start using their heads when naming directories and how they structure directories.  For example, having monthly directories stored as MMMYYYY is insane.  It defies sorting, which is especially important when trying to find directories that can be dropped due to age.  You might thing the created date would be enough until you realize that someone creates a whole year of directories at a time.

    Yep, I always try to set things as yyyymmdd as a default when I can.

  • Steve Jones - SSC Editor - Monday, July 17, 2017 12:44 PM

    Jeff Moden - Monday, July 17, 2017 9:17 AM

    I'd just like to see people start using their heads when naming directories and how they structure directories.  For example, having monthly directories stored as MMMYYYY is insane.  It defies sorting, which is especially important when trying to find directories that can be dropped due to age.  You might thing the created date would be enough until you realize that someone creates a whole year of directories at a time.

    Yep, I always try to set things as yyyymmdd as a default when I can.

    do you prefer yyyymmdd or yyyy-mm-dd?

    412-977-3526 call/text

  • chrisn-585491 - Monday, July 17, 2017 12:32 PM

    That's why we  use YYYY_MM with the MM being the number of the month. So you have folder 2017_07 and such, everything is easy to sort chronologically...

    same here... I have a hard time getting people to understand why I do that, even other IT people sometimes.

  • Chris Harshman - Monday, July 17, 2017 12:07 PM

    Sinisa Jazic - Monday, July 17, 2017 9:42 AM

    If I could talk to an OS (HAL 9000) then I would refer to a file by any name I like.

    LOL I can see it now... "Open up that file that I was working on Friday that had that weird stuff in it with those numbers that didn't balance right"

    I recant.  Typing long filenames is useful and conversing with a computer is a dumb idea.  After all, we wouldn't want something like this to happen:

    MS DBA: Dial Bill Gates.
    <pause>
    HAL 9000: Bill Gates deleted.

  • robert.sterbal 56890 - Monday, July 17, 2017 12:47 PM

    Steve Jones - SSC Editor - Monday, July 17, 2017 12:44 PM

    Jeff Moden - Monday, July 17, 2017 9:17 AM

    I'd just like to see people start using their heads when naming directories and how they structure directories.  For example, having monthly directories stored as MMMYYYY is insane.  It defies sorting, which is especially important when trying to find directories that can be dropped due to age.  You might thing the created date would be enough until you realize that someone creates a whole year of directories at a time.

    Yep, I always try to set things as yyyymmdd as a default when I can.

    do you prefer yyyymmdd or yyyy-mm-dd?

    I use DDMMMYY, so today would be 17JUL17. Zero international confusion, maximum compactness.

  • robert.sterbal 56890 - Monday, July 17, 2017 12:47 PM

    do you prefer yyyymmdd or yyyy-mm-dd?

    Either. I don't have a problem reading them without hyphens, but I wouldn't argue for it.

  • Sinisa Jazic - Monday, July 17, 2017 12:54 PM

    I use DDMMMYY, so today would be 17JUL17. Zero international confusion, maximum compactness.

    It doesn't sort very well

    412-977-3526 call/text

  • robert.sterbal 56890 - Monday, July 17, 2017 1:45 PM

    Sinisa Jazic - Monday, July 17, 2017 12:54 PM

    I use DDMMMYY, so today would be 17JUL17. Zero international confusion, maximum compactness.

    It doesn't sort very well

    True that.  If dates were standardized like numbers, 20170717 would be a naturally sortable date, and int to boot!

  • I had not read that, but it was a fun read. I do agree though, if you properly document a potential problem with your code and users choose to ignore it, then it is not a bug. In this case, it is a restriction in what is a valid first character for a username. It is documented that it needs to start with a lower case letter. Now, how that is handled to me sounds like a bug - it should just prevent the user from being created and that'd be easy to do in the useradd function, but death threats seem a bit harsh for that.

    The fun part of the bug is that useradd can add a user with a leading digit, but when systemd subsequently encounters the user directive in starting a service to run as that user, it errors out because the directive to run as that user is then invalid, but honestly, if the user directive is in error, the system should not execute that directive. Yet, systemd executes the directive, but replaces the requested userid with the superuser (as it defaults to root). It would be much more sensible to just not execute the directive (start the requested service).

    To me, its similar to a delete statement in sql that deletes all the rows because the "where" clause was invalid.

  • patrickmcginnis59 10839 - Monday, July 17, 2017 1:52 PM

    I had not read that, but it was a fun read. I do agree though, if you properly document a potential problem with your code and users choose to ignore it, then it is not a bug. In this case, it is a restriction in what is a valid first character for a username. It is documented that it needs to start with a lower case letter. Now, how that is handled to me sounds like a bug - it should just prevent the user from being created and that'd be easy to do in the useradd function, but death threats seem a bit harsh for that.

    The fun part of the bug is that useradd can add a user with a leading digit, but when systemd subsequently encounters the user directive in starting a service to run as that user, it errors out because the directive to run as that user is then invalid, but honestly, if the user directive is in error, the system should not execute that directive. Yet, systemd executes the directive, but replaces the requested userid with the superuser (as it defaults to root). It would be much more sensible to just not execute the directive (start the requested service).

    To me, its similar to a delete statement in sql that deletes all the rows because the "where" clause was invalid.

    I agree.  Plus there are a few easy to use tricks you could use to fix this:
    1 - change useradd to require it to contain a lowercase digit for creatign the user
    2 - change systemd to handle a user starting with a digit
    3 - not default to userid 0 when the username starts with a digit (default to a negative or something and give a "user not found" type of error)
    4 - change the system function call on the kernel side of things so any functions or commands that require the username OR userID, it would take the argument pass it through a sanitizer that would always return the userID if it exists.

    And probably more methods I am not thinking of... I personally like option 4 the best as it would result in the best future proofing and would handle changing system regions.  The only case where it could become problematic is if you had a username that was entirely digits.  But I expect that is already a bit of a headache for developers and is likely how this problem came about in the first place.  Similar to the no capital letter as the first character as it makes getty(8) think you have an upper-case-only terminal) (as indicated in the link you posted).  A digit as the first character I am assuming (I didn't look at any of the code) makes it think that you are providing a UserID as opposed to a user NAME.  UserID 0 is probably the default on error and UserID of 0 corresponds to "root".

    EDIT - forgot to include my other thoughts - I believe one of the main reasons they don't want to fix this in systemd is that it seems more like a bug in useradd.  But since it is documented, this also feels more like an end user problem than a software bug.  Linux is built a lot more with "the end user knows what they are doing" in mind than Windows.  You want to dump your whole filesystem, it will try... "rm -rf /"  If you try to do that on windows, it'll complain a lot more than in linux... at least the last time I used linux.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 15 posts - 31 through 45 (of 53 total)

You must be logged in to reply to this topic. Login to reply