Re: Tilde expansion on Win32

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tilde expansion on Win32
Date: 2005-06-10 14:40:52
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E490E44D@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Bruce Momjian
> Sent: 10 June 2005 15:31
> To: PostgreSQL-development
> Subject: [HACKERS] Tilde expansion on Win32
>
> I noticed that we don't expand tildes in Win32 because of the use of
> tilde in short versions of long file names:
>
> char *
> expand_tilde(char **filename)
> {
> if (!filename || !(*filename))
> return NULL;
>
> /* MSDOS uses tilde for short versions of long file
> names, so skip it. */
> #ifndef WIN32
>
> /* try tilde expansion */
> if (**filename == '~')
> {
>
> However, I thought the tilde was usually used toward the end
> of the file
> name, not at the beginning. Is this true? Should this code
> be modified?

Yes, it's true - long filenames may be shortened to something like

Long filename.document -> longfi~1.doc

To munge them into 8.3 format. Without looking at the code I assume that
it is expanding ~dpage into /home/dpage or whatever? If so, I'd be
inclined to leave it - tilde isn't used like that on Windows.

Regards, Dave

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-10 14:42:58 Re: Tilde expansion on Win32
Previous Message Joshua D. Drake 2005-06-10 14:38:32 Re: Tilde expansion on Win32