PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] Trailing Slashes Command Line
Date: Friday, 11 Sep 2020, 09:28:48


    > Message Posted By: Unknown
    >
    > How does the trailing slashes on the command line work?

As stated in the specification, fiend must

  Preserve trailing /'s in filenames that appear on the command line.  E.g.,

    % fiend .//// -maxdepth 0
    .////
=====

    > Lets say I do ./fiend ./////, does that mean for every file and directory
    > in my current_directory, I do not add another slash and then the file
    > name. I.e. if the file A is in my current directory, then in my traverse
    > function I would go to ./////A and not .//////A?

Yes, as you can verify using /bin/find or Hwk1/fiend.  A
better example than that in the specification is

  % ./fiend /c// -maxdepth 1
  /c//
  /c//c
  ...
=====

    > In Linux find, it seems that it would be .//////A, but in the fiend
    > solution it is ./////A. We can also see this by doing /c/cs323/Hwk1/fiend
    > ./ vs find ./

That is not what I get.  For example (using fewer
slashes to make the result more evident):

  % find /c// -maxdepth 1 | head -2
  /c//
  /c//c
  % ./fiend /c// -maxdepth 1 | head -2
  /c//
  /c//c

--Stan-
PREV INDEX NEXT