Menu

#246 problems with XDEL command

freedos13
open
Jim Hall
None
4
2024-08-15
2019-08-25
No

I assume these are known problems with the XDEL command in version 1.3 RC1, but this regards two situations:

1) where you want to delete all files of the same extension that exist one folder level down from where you execute the command. It does not delete the files, at least in the situation where the directory name contains an extension (ex: WPTAIL.UNI directory in FreeDOS\AppInfo). To get around that problem I used the DIR /B /S . > delete.lst command to create a barebones list of files to be deleted using the '@' option. That did work.

2) the next thing I tried to do is delete all the empty directories with the .UNI extension using the command XDEL *.UNI /D. That does not work as upon execution, the command always truncates the last letter of the extension. So when it gets to deleting WPTAIL.UNI, it reports that it cannot delete WPTAIL.UN (which does not exist). I renamed directory to WPTAIL.UN thinking that will work but it results in a report it cannot delete WPTAIL.U, and when you rename by removing the extension entirely, it says it cannot remove the directory name (which is finally correctly represented).

Related to the first issue with XDEL is that when trying to delete all instances of a filename in subfolders (using a wildcard), the prompt does not come up until AFTER I hit enter or another key. In other words, the action I take precedes the prompt and the command terminates without the answer to the prompt being received by the program.

Related

Bugs: #246

Discussion

  • Steve Sybesma

    Steve Sybesma - 2019-08-25

    Note, the asterisks were removed from the wildard in the first command example I gave.
    DIR /B /S . > delete.lst
    Supposed to be DIR /B /S (star-dot-star) > delete.lst

     
  • Jim Hall

    Jim Hall - 2019-09-13

    Thanks for letting us know. I also saw your report on the freedos-user list. This is definitely a broken XDEL.

    TODO: will either fix or remove from next distro.

     
    • Steve Sybesma

      Steve Sybesma - 2019-09-14

      Don't know if the point was missed but the wildcard somehow didn't show
      in the command example I gave back on August 25th.

      DIR /B /S . > delete.lst

      was supposed to read as...

      DIR /B /S {star dot star} > delete.lst

      Thanks,

      Steve

       

      Last edit: Jim Hall 2021-06-19
  • Jim Hall

    Jim Hall - 2021-06-19

    Additional testing in FreeDOS 1.3 RC4 .. testing the last item mentioned in this bug report:

    If I go into a directory with files that I want to delete, and type: XDEL README.TXT then the program prints this:

       path: C:\TEMP\RMENU10
       file: README.TXT
    

    ..then XDEL just pauses until I hit Enter, then I see this extra line printed:

    Is this what you wish to do? [yn]
    

    ..and the README.TXT file remains.

    If I re-run the same command and press y when XDEL pauses, it prints:

    YIs this what you wish to do? [yn]
    

    ..and the README file file is now deleted. (no output)

    I think the problem is that XDEL is not flushing stdout when it asks for the keyboard input. So the Is this what you wish to do? [yn] is stuck until stdout is flushed when Y is printed after confirmation.

    Testing that theory, if I instead type: XDEL /Y *.EXE (the /Y option indicates "always answer yes") the exe program in the current directory is deleted. (no output) That's because XDEL didn't need to print a prompt.

    Similarly, XDEL /N *.TXT (the /N indicates "no warning") the text files in the current directory are deleted. (no output)

     
  • Jim Hall

    Jim Hall - 2021-06-19

    BTW, using both /N and /Y as options to "delete specified files with no warning" seems odd and dangerous to the user. From the user perspective, you might assume /Y means "always yes" and /N means "always no" .. but actually they both mean the same thing.

    But that's documented in the /? help, and even has a "CAREFUL!" message on that option .. so I guess this is as designed.

     
  • Jim Hall

    Jim Hall - 2021-06-19

    Testing deleting directories with extensions .. I created two empty directories, TEST1.DIR and TEST2.DIR

    If I type XDEL *.DIR /D /Y as indicated in the bug report, I get this output:

     Could not delete Directory: TEST1.DI
     Could not delete Directory: TEST2.DI
    

    (Not that it matters, but I get the same if I run the command with the options up front as XDEL /D /Y *.DIR)

    Same problem if I name the directories on the command line, without globbing: XDEL TEST1.DIR TEST2.DIR /D /Y

     Could not delete Directory: TEST1.DI
     Could not delete Directory: TEST2.DI
    

    The /D option is documented in /? as "remove empty subdirectories" so this seems the correct option.

     
  • Jim Hall

    Jim Hall - 2021-06-19

    Interestingly, if I add the /S option, the directories are deleted: XDEL *.DIR /d /y /s

    ..and I don't get any output, and the TEST1.DIR and TEST2.DIR directories are deleted.

     
  • Jim Hall

    Jim Hall - 2021-06-19

    So this seems to be an issue of what options you provide to XDEL to get it to delete subdirectories for you. Maybe the /S option is the correct option for that, and not just /D

    Except that (after I create the TEST1.DIR directory again) running XDEL TEST1.DIR /y /s doesn't delete the directory.

    Maybe XDEL really needs both /S and /D to delete an empty directory.

     
  • Jim Hall

    Jim Hall - 2021-06-19

    Also: bug is reproduced without extensions. If I have a TESTDIR directory, and try to delete it with XDEL TESTDIR /d /y I get this output:

     Could not delete Directory: TESTDI
    

    ..and the directory is not deleted until I run XDEL TESTDIR /d /y /s

     
    • Robert Riebisch

      Robert Riebisch - 2021-06-19

      Could not delete Directory: TESTDI

      This is probably a result of the line: file[strlen(file)-1]=0; // remove final '\\'

      It came to my mind, that you are just using the wrong syntax. So I tried XDEL TESTDIR\ /d /y:

      Invalid name in "testdir\"
      

      Next try: XDEL TESTDIR\*.* /d /y --> no output, but TESTDIR still present.
      HISTORY.TXT says:

      It has one major difference:
          XDEL /SRDN DIR\*.*
      will delete all files and subdirectories just as
          DELTREE /Y DIR\*.*
      but the directory DIR\  will NOT be removed (This is the DR-DOS standard)
      

      Not to remove TESTDIR in our test case seems to be correct. But then, why does XDEL TESTDIR /d /y /s so?

      This is by design:

        if (!(options&OPT_NO_WARN)&&!AskDelete(dir,name))// no Warning
         retValue=ERR_DELETE;                 // error deleting file...
        else
         retValue=xDel2(dir,name);            // Deletes first level
       }
      

      By the way: XDEL source code is really hard to read for me w/o syntax highlighting. Good, that I have FED.

       

      Last edit: Robert Riebisch 2021-06-19
  • Jim Hall

    Jim Hall - 2021-06-19

    Either way, XDIR seems like it has some issues (not flushing stdout, not showing full dir name on error) and seems confusing (/S vs /D)

    ..so maybe we don't need XDEL in the FreeDOS distribution? Not seeing the benefit to this program since we already have DEL and RMDIR and DELTREE.

     
    • Robert Riebisch

      Robert Riebisch - 2021-06-19

      Regarding the benefit:

      XDEL was introduced by DR-DOS and a long time later M$ introduced deltree.
       This implementation of XDEL is intended to be 100% compatible with
       DR-DOS version. If you find anything different, consider it a bug
       and send me a notofication, please.
      
      XDEL can be used in place of deltree, but in fact it has more options, including:
      
      - default is not to delete Read/Only files,
      - option to include _or_not_ subdirectories
      - option to wipe all files before deleting.
      - options to ask or not for confirmation, individualy or globaly
      

      So maybe we should just fix the bugs and quirks.

       
  • fritz.mueller

    fritz.mueller - 2022-05-22

    Hi,
    I just tested xdel204 (older version from Ibiblio): The result is:
    a) on a real DOS machine xdel204 /? shows the help whereas
    b) in Virtualbox xdel204 /? hangs without showing the help

    xdel206 shows the help in both machines but wants the answer to the question "Is this what you want" before. It would be fine to fix this first to find out if there are more problems with it.

    Thx.

     
  • fritz.mueller

    fritz.mueller - 2022-05-23

    Hi,
    I just had a short mail contact with the programmer of xdel - and he fixed the "answer-question" bug in one day.
    Please check if everything works fine now.
    @Jerome: There is a lot of NLS support files on your site, could you please add them?

    Thx.

     
    • Shidel

      Shidel - 2022-05-24

      Thanks Willi,

      I updated the package for GitLab Archive Package and the Unstable Updates version.

      Also, I put a raw version for @jhall1 in the file mirrors on ibiblio.

       
  • Alain Mouette

    Alain Mouette - 2022-05-25

    Hi, I am the author of XDEL 2.06. Sorry but I didn't know about these bugs until recently as I have been notified by private email and I haven't seen it in the email lists :(
    AS a justification, I needed XDEL functionalities for some automatic instalations .BAT, instead of doing just what I needed writing a clone of DR-DOS XDEL seemed a better option. Someone converted it to NLS for me, thanks, but I don't remember who it was :(

    I have made a XDEL 2.07 to correct the prompt not showing bug.

    Unfortunatly I cannot reproduce the delete directory problem, can someone help me with this. Maybe it only shows in certain environments

     
    • Steve Sybesma

      Steve Sybesma - 2022-05-25

      Hello Alain,

      I carefully detailed the problem and what you would need to do to see
      it.

      It happens with the XDEL command that is/was part of FreeDOS 1.3 RC1

      In this case it was installed in a VirtualBox for Windows VM but that
      should not matter.

      If you like we can get together sometime on a TeamViewer session after I
      setup my FreeDOS VM again and I can show the problem to you.

      Thanks for your reply,

      Steve Sybesma

      On 2022-05-25 06:26, Alain Mouette wrote:

      Hi, I am the author of XDEL 2.06. Sorry but I didn't know about these
      bugs until recently as I have been notified by private email and I
      haven't seen it in the email lists :(
      AS a justification, I needed XDEL functionalities for some automatic
      instalations .BAT, instead of doing just what I needed writing a clone
      of DR-DOS XDEL seemed a better option. Someone converted it to NLS for
      me, thanks, but I don't remember who it was :(

      I have made a XDEL 2.07 to correct the prompt not showing bug.

      Unfortunatly I cannot reproduce the delete directory problem, can
      someone help me with this. Maybe it only shows in certain environments

      Attachments:

      • xdel207.zip [1] (31.0 kB; application/zip)

      [bugs:#246] [2] problems with XDEL command

      Status: open
      Group: freedos13
      Created: Sun Aug 25, 2019 05:57 AM UTC by Steve Sybesma
      Last Updated: Tue May 24, 2022 07:15 AM UTC
      Owner: Jim Hall

      I assume these are known problems with the XDEL command in version 1.3
      RC1, but this regards two situations:

      1) where you want to delete all files of the same extension that exist
      one folder level down from where you execute the command. It does not
      delete the files, at least in the situation where the directory name
      contains an extension (ex: WPTAIL.UNI directory in FreeDOS\AppInfo). To
      get around that problem I used the DIR /B /S . > delete.lst command
      to create a barebones list of files to be deleted using the '@' option.
      That did work.

      2) the next thing I tried to do is delete all the empty directories
      with the .UNI extension using the command XDEL *.UNI /D. That does not
      work as upon execution, the command always truncates the last letter of
      the extension. So when it gets to deleting WPTAIL.UNI, it reports that
      it cannot delete WPTAIL.UN (which does not exist). I renamed directory
      to WPTAIL.UN thinking that will work but it results in a report it
      cannot delete WPTAIL.U, and when you rename by removing the extension
      entirely, it says it cannot remove the directory name (which is finally
      correctly represented).

      Related to the first issue with XDEL is that when trying to delete all
      instances of a filename in subfolders (using a wildcard), the prompt
      does not come up until AFTER I hit enter or another key. In other
      words, the action I take precedes the prompt and the command terminates
      without the answer to the prompt being received by the program.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/freedos/bugs/246/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      [1]
      https://sourceforge.net/p/freedos/bugs/_discuss/thread/840f000fb8/4099/attachment/xdel207.zip
      [2] https://sourceforge.net/p/freedos/bugs/246/

       

      Related

      Bugs: #246

      • Steve Sybesma

        Steve Sybesma - 2022-05-25

        Hello everyone,

        My email to Alain bounced back to me. Not sure why.

        The CC email showing for him is: alainm3@users.sourceforge.net

        That may be why he didn't see it in the mailing list.

        Steve Sybesma

        On 2022-05-25 08:10, steve@vwebr.net wrote:

        Hello Alain,

        I carefully detailed the problem and what you would need to do to see
        it.

        It happens with the XDEL command that is/was part of FreeDOS 1.3 RC1

        In this case it was installed in a VirtualBox for Windows VM but that
        should not matter.

        If you like we can get together sometime on a TeamViewer session after
        I setup my FreeDOS VM again and I can show the problem to you.

        Thanks for your reply,

        Steve Sybesma

        On 2022-05-25 06:26, Alain Mouette wrote:

        Hi, I am the author of XDEL 2.06. Sorry but I didn't know about these
        bugs until recently as I have been notified by private email and I
        haven't seen it in the email lists :(
        AS a justification, I needed XDEL functionalities for some automatic
        instalations .BAT, instead of doing just what I needed writing a clone
        of DR-DOS XDEL seemed a better option. Someone converted it to NLS for
        me, thanks, but I don't remember who it was :(

        I have made a XDEL 2.07 to correct the prompt not showing bug.

        Unfortunatly I cannot reproduce the delete directory problem, can
        someone help me with this. Maybe it only shows in certain environments

        Attachments:

        • xdel207.zip [1] (31.0 kB; application/zip)

        [bugs:#246] [2] problems with XDEL command

        Status: open
        Group: freedos13
        Created: Sun Aug 25, 2019 05:57 AM UTC by Steve Sybesma
        Last Updated: Tue May 24, 2022 07:15 AM UTC
        Owner: Jim Hall

        I assume these are known problems with the XDEL command in version 1.3
        RC1, but this regards two situations:

        1) where you want to delete all files of the same extension that exist
        one folder level down from where you execute the command. It does not
        delete the files, at least in the situation where the directory name
        contains an extension (ex: WPTAIL.UNI directory in FreeDOS\AppInfo).
        To get around that problem I used the DIR /B /S . > delete.lst
        command to create a barebones list of files to be deleted using the
        '@' option. That did work.

        2) the next thing I tried to do is delete all the empty directories
        with the .UNI extension using the command XDEL *.UNI /D. That does not
        work as upon execution, the command always truncates the last letter
        of the extension. So when it gets to deleting WPTAIL.UNI, it reports
        that it cannot delete WPTAIL.UN (which does not exist). I renamed
        directory to WPTAIL.UN thinking that will work but it results in a
        report it cannot delete WPTAIL.U, and when you rename by removing the
        extension entirely, it says it cannot remove the directory name (which
        is finally correctly represented).

        Related to the first issue with XDEL is that when trying to delete all
        instances of a filename in subfolders (using a wildcard), the prompt
        does not come up until AFTER I hit enter or another key. In other
        words, the action I take precedes the prompt and the command
        terminates without the answer to the prompt being received by the
        program.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/freedos/bugs/246/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

        [1]
        https://sourceforge.net/p/freedos/bugs/_discuss/thread/840f000fb8/4099/attachment/xdel207.zip
        [2] https://sourceforge.net/p/freedos/bugs/246/

         

        Related

        Bugs: #246

  • Alain Mouette

    Alain Mouette - 2022-05-26

    I did found a way to reproduce it, I used FreeDOS pure in VirtualBox.
    Now I can fix it :)

     

    Last edit: Alain Mouette 2022-05-26
  • Alain Mouette

    Alain Mouette - 2022-05-26

    Fixed :)
    This was ultimately caused by omitting the "\" at the end of the directory name. Ok now both ways.

    Please test further.

    SideNOTE: I feel that there is also some confusing and conflicting reports about options. Please suggest how I can improuve option's descriptions, or eventialy fix it if it is really buggy

     
  • fritz.mueller

    fritz.mueller - 2024-08-15

    The bugs were fixed.
    I think this ticket can be closed.

     

    Last edit: fritz.mueller 2024-08-16

Log in to post a comment.

MongoDB Logo MongoDB