Unix Technical Forum

Can't change working directory to C:/Documents and Settings in Windows

This is a discussion on Can't change working directory to C:/Documents and Settings in Windows within the Pgsql General forums, part of the PostgreSQL category; --> Hello, I am running the windows version of PostgreSQL 8.1 on my XP laptop. I was trying the \cd ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 07:11 PM
Casey Crosbie
 
Posts: n/a
Default Can't change working directory to C:/Documents and Settings in Windows

Hello,

I am running the windows version of PostgreSQL 8.1 on my XP laptop. I
was trying the \cd command to change working directories [to import
query files to run] to the Documents and Settings directory (eventually
to the desktop) and I am getting an error where psql doesn't recognize
the gap between Documents and Settings.

The error states,

\cd : could not change directory to "C:/Documents": No such file or
directory.

Does anyone have any solutions on how to get around this issue with the
Documents and Settings directory?

Thank you in advance!

Casey Crosbie

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 07:11 PM
Casey Crosbie
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents andSettings in Windows

Andrej,

Thanks for the suggestion. As you said, I tried enclosing "Documents and
Setting" and even "C:/Documents and Settings" and neither worked. Please
let me know if you have any other ideas.

Thanks,

Casey

Andrej Ricnik-Bay wrote:
> On 7/2/07, Casey Crosbie <casey.crosbie@noaa.gov> wrote:
>> Hello,
>>
>> I am running the windows version of PostgreSQL 8.1 on my XP laptop. I
>> was trying the \cd command to change working directories [to import
>> query files to run] to the Documents and Settings directory (eventually
>> to the desktop) and I am getting an error where psql doesn't recognize
>> the gap between Documents and Settings.
>>
>> The error states,
>>
>> \cd : could not change directory to "C:/Documents": No such file or
>> directory.
>>
>> Does anyone have any solutions on how to get around this issue with the
>> Documents and Settings directory?

> Try enclosing Documents and Settings in quotes ...
> "Documents and Settings"
>
>> Thank you in advance!

>
>> Casey Crosbie

> Cheers,
> Andrej
>
>


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 07:12 PM
Jorge Godoy
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents and Settings in Windows

On Sunday 01 July 2007 21:51:08 Casey Crosbie wrote:
> Andrej,
>
> Thanks for the suggestion. As you said, I tried enclosing "Documents and
> Setting" and even "C:/Documents and Settings" and neither worked. Please
> let me know if you have any other ideas.


This looks like that ooooooooold Windows bug. Try using "Document~1" as the
directory name.


--
Jorge Godoy <jgodoy@gmail.com>


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 07:12 PM
Casey Crosbie
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents andSettings in Windows

Jorge,

Thanks for the suggestion. But unfortunately, I tried both
\cd "C:/Document~1" and just \cd C:/"Document~1" and neither worked.

Casey

Jorge Godoy wrote:
> On Sunday 01 July 2007 21:51:08 Casey Crosbie wrote:
>> Andrej,
>>
>> Thanks for the suggestion. As you said, I tried enclosing "Documents and
>> Setting" and even "C:/Documents and Settings" and neither worked. Please
>> let me know if you have any other ideas.

>
> This looks like that ooooooooold Windows bug. Try using "Document~1" as the
> directory name.
>
>


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 07:12 PM
Jorge Godoy
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents and Settings in Windows

On Sunday 01 July 2007 22:25:24 Casey Crosbie wrote:
> Jorge,
>
> Thanks for the suggestion. But unfortunately, I tried both
> \cd "C:/Document~1" and just \cd C:/"Document~1" and neither worked.


Sorry. It should be up to 8 chars: "Docume~1" or some variation like that
(I've seen ~2 due to some unknown reason). This looks like a Windows
problem on finding directories with spaces in its name. The same happens
with diacriticals...


--
Jorge Godoy <jgodoy@gmail.com>


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 07:12 PM
Casey Crosbie
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents andSettings in Windows

Jorge,

The \cd C:/Docume~1 worked! Thank you very much for your help!

Casey

Jorge Godoy wrote:
> On Sunday 01 July 2007 22:25:24 Casey Crosbie wrote:
>> Jorge,
>>
>> Thanks for the suggestion. But unfortunately, I tried both
>> \cd "C:/Document~1" and just \cd C:/"Document~1" and neither worked.

>
> Sorry. It should be up to 8 chars: "Docume~1" or some variation like that
> (I've seen ~2 due to some unknown reason). This looks like a Windows
> problem on finding directories with spaces in its name. The same happens
> with diacriticals...
>
>


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 07:12 PM
Tom Lane
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents and Settings in Windows

Jorge Godoy <jgodoy@gmail.com> writes:
> On Sunday 01 July 2007 22:25:24 Casey Crosbie wrote:
>> Jorge,
>> Thanks for the suggestion. But unfortunately, I tried both
>> \cd "C:/Document~1" and just \cd C:/"Document~1" and neither worked.


> Sorry. It should be up to 8 chars: "Docume~1" or some variation like that
> (I've seen ~2 due to some unknown reason). This looks like a Windows
> problem on finding directories with spaces in its name. The same happens
> with diacriticals...


FWIW, on a Unix machine I get

$ mkdir "foo bar"
$ psql regression
Welcome to psql 8.2.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

regression=# \cd foo bar
\cd: could not change directory to "foo": No such file or directory
regression=# \cd "foo bar"
\cd: could not change directory to ""foo bar"": No such file or directory
regression=# \cd 'foo bar'
regression=# \!pwd
/home/tgl/pgsql/foo bar
regression=#

So maybe single quotes would work better.

I'm not sure if the behavior with double quotes should be considered a
bug or not. Too lazy to check the manual, but I believe psql thinks
single and double quotes are different.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-09-2008, 07:12 PM
Casey Crosbie
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents andSettings in Windows

Tom,

Thanks for that bit of insight on using the directories in Unix. I
originally tried no quotes or double quotes for my directory change and
no quotes worked for me. But after your mentioning the single quotes I
tested it out and those seem to work in Windows psql directory changes
as well.

Casey

Tom Lane wrote:
> Jorge Godoy <jgodoy@gmail.com> writes:
>> On Sunday 01 July 2007 22:25:24 Casey Crosbie wrote:
>>> Jorge,
>>> Thanks for the suggestion. But unfortunately, I tried both
>>> \cd "C:/Document~1" and just \cd C:/"Document~1" and neither worked.

>
>> Sorry. It should be up to 8 chars: "Docume~1" or some variation like that
>> (I've seen ~2 due to some unknown reason). This looks like a Windows
>> problem on finding directories with spaces in its name. The same happens
>> with diacriticals...

>
> FWIW, on a Unix machine I get
>
> $ mkdir "foo bar"
> $ psql regression
> Welcome to psql 8.2.4, the PostgreSQL interactive terminal.
>
> Type: \copyright for distribution terms
> \h for help with SQL commands
> \? for help with psql commands
> \g or terminate with semicolon to execute query
> \q to quit
>
> regression=# \cd foo bar
> \cd: could not change directory to "foo": No such file or directory
> regression=# \cd "foo bar"
> \cd: could not change directory to ""foo bar"": No such file or directory
> regression=# \cd 'foo bar'
> regression=# \!pwd
> /home/tgl/pgsql/foo bar
> regression=#
>
> So maybe single quotes would work better.
>
> I'm not sure if the behavior with double quotes should be considered a
> bug or not. Too lazy to check the manual, but I believe psql thinks
> single and double quotes are different.
>
> regards, tom lane


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-09-2008, 07:12 PM
Magnus Hagander
 
Posts: n/a
Default Re: Can't change working directory to C:/Documents and Settings in Windows

On Sun, Jul 01, 2007 at 10:46:22PM -0300, Jorge Godoy wrote:
> On Sunday 01 July 2007 22:25:24 Casey Crosbie wrote:
> > Jorge,
> >
> > Thanks for the suggestion. But unfortunately, I tried both
> > \cd "C:/Document~1" and just \cd C:/"Document~1" and neither worked.

>
> Sorry. It should be up to 8 chars: "Docume~1" or some variation like that
> (I've seen ~2 due to some unknown reason). This looks like a Windows
> problem on finding directories with spaces in its name. The same happens
> with diacriticals...


To help others in the future, the way to find out what the directory short
name actually is, use "dir /x c:\".

Not that it was the problem this time, but I'm sure someone will need it at
some point.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com