Author Topic: 'cd' doesn't seem to understand paths  (Read 2282 times)

dhjdhj

  • Community Member
  • Posts: 17
  • Hero Points: 0
'cd' doesn't seem to understand paths
« on: October 22, 2013, 12:11:49 pm »
I'm running SE 2013. I have a shell open in the Build pane at the bottom. While I can switch folders with 'cd' one at a time, I cannot enter a complete path to a new folder, I get told it doesn't exist.

Out of curiosity, after finally getting to the location I needed, I used pwd to display the entire path, copied the path to clipboard and then pasted it as an argument to 'cd' and was told "no such file or directory"

Graeme

  • Senior Community Member
  • Posts: 2430
  • Hero Points: 322
Re: 'cd' doesn't seem to understand paths
« Reply #1 on: October 22, 2013, 01:16:09 pm »
What operating system are you using?  cd works correctly for me on Windows.

cd is actually the name of a slickedit macro and it expands directory aliases before calling chdir.  Perhaps you have a directory alias that's interfering.  What do you get if you type cd /?
Try calling chdir instead.


dhjdhj

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: 'cd' doesn't seem to understand paths
« Reply #2 on: October 22, 2013, 01:48:46 pm »
Sorry --- I'm on Macintosh.

As far as I know, there is no chdir on OS X. There must be a general way to bypass slickedit macros that have the same names as shell commands.

Graeme

  • Senior Community Member
  • Posts: 2430
  • Hero Points: 322
Re: 'cd' doesn't seem to understand paths
« Reply #3 on: October 23, 2013, 12:02:00 am »
What exactly is the error message you're getting?  "no such file or directory" is not the error message you should get from the CD command.

It may be that slick doesn't interpret commands in the build window as slick macros  - so it's probably your operating system that's giving the error.  Try the cd command on the slick command line instead of in the build window.  What does "cd .." or "dir" do in the build window?

dhjdhj

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: 'cd' doesn't seem to understand paths
« Reply #4 on: October 23, 2013, 01:31:45 am »
Take a look at the following transcript where I use cd to navigate one folder at a time. In particular, take a look at the very last line --- note how the path is different in the error message. I observed that if I try to cd to a shorter path (i.e, cd /Volumes/External1/src/MiscProjects), it works, but as soon as I appended the next folder, I got the same kind of error message with an incorrect path. It's as if the incoming argument is not being processed properly if it's longer than some rather short length

It's certainly not the operating system but it looks like it might be related to the default shell that SlickEdit uses. At one point I used def_build_shell to change the shell to /bin/bash and then 'cd' worked exactly as I expected.
--------------------------------


[SE dhj@DHJiMac ScorecererUtil]$ cd
[SE dhj@DHJiMac dhj]$ pwd
/Users/dhj
[SE dhj@DHJiMac dhj]$ cd /Volumes
[SE dhj@DHJiMac Volumes]$ cd External1
[SE dhj@DHJiMac External1]$ pwd
/Volumes/External1
[SE dhj@DHJiMac External1]$ cd src
[SE dhj@DHJiMac src]$ pwd
/Volumes/External1/src
[SE dhj@DHJiMac src]$ cd MiscProjects
[SE dhj@DHJiMac MiscProjects]$ pwd
/Volumes/External1/src/MiscProjects
[SE dhj@DHJiMac MiscProjects]$ cd FreePascalProjects
[SE dhj@DHJiMac FreePascalProjects]$ pwd
/Volumes/External1/src/MiscProjects/FreePascalProjects
[SE dhj@DHJiMac FreePascalProjects]$ cd ScorecererUtil
[SE dhj@DHJiMac ScorecererUtil]$ pwd
/Volumes/External1/src/MiscProjects/FreePascalProjects/ScorecererUtil
[SE dhj@DHJiMac ScorecererUtil]$ cd /Volumes/External1/src/MiscProjects/FreePascalProjects/ScorecererUtil
/Volumes/External1/src/MiscProjects/FreePascalProjectsorecrecererUtil: No such file or directory
[SE dhj@DHJiMac ScorecererUtil]$

Graeme

  • Senior Community Member
  • Posts: 2430
  • Hero Points: 322
Re: 'cd' doesn't seem to understand paths
« Reply #5 on: October 23, 2013, 02:16:35 am »
Scorecerer.  Rhymes with sorcerer.  Makes my head spin.  Perhaps you could use a more  pronouncable name. :)

So how do you get ProjectsorecrecererUtil:  from Projects/ScorecererUtil

ScorecrecererUtil

It's very jumbled.  Is it any different if you do CD on the slick cmd line?  Can you reproduce the problem with other pathnames?  If so, maybe report to slickedit and describe how to reproduce.  I don't have a mac to test on.



dhjdhj

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: 'cd' doesn't seem to understand paths
« Reply #6 on: October 23, 2013, 02:51:08 am »
"Scorecerer" is the name of a product my company sells for the iPad for managing sheet music scores. At the time, we thought it was a cute play on the word but you're right that it is a bit of a tongue twister. It has MIDI support as well and I use it myself with two touring bands with which I play.

As for how you get ProjectsorecrecererUtil:  from Projects/ScorecererUtil, that is precisely why I posted the question in the first place! If the path is too long, it appears to get mangled by the 'cd' command.

Phil Barila

  • Senior Community Member
  • Posts: 742
  • Hero Points: 61
Re: 'cd' doesn't seem to understand paths
« Reply #7 on: October 23, 2013, 03:43:14 am »
What happens when you double the '/' character preceding the 'S' in Scorecerer?  It looks like it's treating /S as an escape.  Try "FreePascalProjects//ScorecererUtil" or some variation on that?

dhjdhj

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: 'cd' doesn't seem to understand paths
« Reply #8 on: October 23, 2013, 03:53:57 am »
I wouldn't expect that to be the case. If that was the problem then it would be breaking with  "/" in the path.

Just for fun, I left off the last folder....note how it got returned ---- the "ep" of FreePascalProjects was replaced with "sc"

Whatever is going on, it would seem that an input string that is too long is just getting corrupted.

[SE dhj@DHJiMac ScorecererUtil]$ cd /Volumes/External1/src/MiscProjects/FreePascalProjects
/Volumes/External1/src/MiscProjects/FrescascalProjects: No such file or directory