Thread: Error opening file without suffix

Error opening file without suffix

From
Michal Kozusznik
Date:
Issue found in pgAdmin 1.14.2, Windows 7

How to reproduce:
1. create some text file and save it without suffix - make sure OS 
doesn't hide suffixes making you think that there is no suffix in a filename
2. Open query editor window
3. Select File / Open...
4. Enter star character (*) into filename field and commit it hitting 
enter - in result you will get all files listed in file browser
5. find your file
6. select it and open it - this operation will end up with error: "can't 
open file"




Re: Error opening file without suffix

From
Michael Shapiro
Date:
I can't replicate this problem. It works for me.<br />I am running pgAdmin 1.14.2, Windows 7<br /><br /><div
class="gmail_quote">OnMon, Jul 23, 2012 at 3:58 AM, Michal Kozusznik <span dir="ltr"><<a
href="mailto:kozusznik.michal@ifortuna.cz"target="_blank">kozusznik.michal@ifortuna.cz</a>></span> wrote:<br
/><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Issue found in
pgAdmin1.14.2, Windows 7<br /><br /> How to reproduce:<br /> 1. create some text file and save it without suffix - make
sureOS doesn't hide suffixes making you think that there is no suffix in a filename<br /> 2. Open query editor
window<br/> 3. Select File / Open...<br /> 4. Enter star character (*) into filename field and commit it hitting enter
-in result you will get all files listed in file browser<br /> 5. find your file<br /> 6. select it and open it - this
operationwill end up with error: "can't open file"<span class="HOEnZb"><font color="#888888"><br /><br /><br /><br />
--<br /> Sent via pgadmin-support mailing list (<a href="mailto:pgadmin-support@postgresql.org"
target="_blank">pgadmin-support@postgresql.<u></u>org</a>)<br/> To make changes to your subscription:<br /><a
href="http://www.postgresql.org/mailpref/pgadmin-support"
target="_blank">http://www.postgresql.org/<u></u>mailpref/pgadmin-support</a><br/></font></span></blockquote></div><br
/>

Re: Error opening file without suffix

From
"Martin French"
Date:
<p><tt><font size="2"> <br />> I can't replicate this problem. It works for me.<br />> I am running pgAdmin
1.14.2,Windows 7<br /></font></tt><br /><font face="sans-serif" size="2">Replicated on 1.14.3, Windows 7 x64.</font><br
/><tt><fontsize="2"><br />> How to reproduce:<br />> 1. create some text file and save it without suffix - make
sureOS <br />> doesn't hide suffixes making you think that there is no suffix in a filename<br />> 2. Open query
editorwindow<br />> 3. Select File / Open...<br />> 4. Enter star character (*) into filename field and commit it
<br/>> hitting enter - in result you will get all files listed in file browser<br />> 5. find your file<br />>
6.select it and open it - this operation will end up with error: <br />> "can't open file"<br /></font></tt><br
/><br/><font face="sans-serif" size="2">1. created file: H:\Postgres Scripts\test</font><br /><font face="sans-serif"
size="2">2.opened editor</font><br /><font face="sans-serif" size="2">3. file > open</font><br /><font
face="sans-serif"size="2">4. typed *, hit enter</font><br /><font face="sans-serif" size="2">5. found file " test
"</font><br/><font face="sans-serif" size="2">6: Brings up:</font><br /><br /><font face="sans-serif" size="2"> An
Errorhas occurred:</font><br /><br /><font face="sans-serif" size="2"> Can't open file 'c:\path\test.sql' (error 2: the
systemcannot find the file specified)</font><br /><br /><font face="sans-serif" size="2">note that ".sql" has been
appendedto the name of my test file. Probably as the file spec is set to *.sql.  If you use the dropdown and select
*.*,then it works fine.</font><br /><br /><font face="sans-serif" size="2">Cheers</font><br /><br /><font
face="sans-serif"size="2">Martin</font><font face="sans-serif">============================================= Romax
TechnologyLimited Rutherford House Nottingham Science & Technology Park Nottingham, NG7 2PZ England Telephone
numbers:+44 (0)115 951 88 00 (main) For other office locations see: http://www.romaxtech.com/Contact
================================================ E-mail: info@romaxtech.com Website: www.romaxtech.com
================================================= Confidentiality Statement This transmission is for the addressee only
andcontains information that is confidential and privileged. Unless you are the named addressee, or authorised to
receiveit on behalf of the addressee you may not copy or use it, or disclose it to anyone else. If you have received
thistransmission in error please delete from your system and contact the sender. Thank you for your cooperation.
=================================================</font>

Re: Error opening file without suffix

From
Guillaume Lelarge
Date:
On Mon, 2012-07-23 at 15:20 +0100, Martin French wrote:
>  
> > I can't replicate this problem. It works for me.
> > I am running pgAdmin 1.14.2, Windows 7
> 
> Replicated on 1.14.3, Windows 7 x64.
> 
> > How to reproduce:
> > 1. create some text file and save it without suffix - make sure OS 
> > doesn't hide suffixes making you think that there is no suffix in a
> filename
> > 2. Open query editor window
> > 3. Select File / Open...
> > 4. Enter star character (*) into filename field and commit it 
> > hitting enter - in result you will get all files listed in file
> browser
> > 5. find your file
> > 6. select it and open it - this operation will end up with error: 
> > "can't open file"
> 
> 
> 1. created file: H:\Postgres Scripts\test
> 2. opened editor
> 3. file > open
> 4. typed *, hit enter
> 5. found file " test "
> 6: Brings up:
> 
> An Error has occurred:
> 
> Can't open file 'c:\path\test.sql' (error 2: the system cannot find
> the file specified)
> 
> note that ".sql" has been appended to the name of my test file.
> Probably as the file spec is set to *.sql.  If you use the dropdown
> and select *.*, then it works fine.
> 

There's not much we can do here. We show the standard dialog, and it
tells us which file the user wants to open. If it tells to open
"test.sql", we have no way to understand you wanted to open the file
"test".


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Error opening file without suffix

From
Kozusznik Michal
Date:
please check file dialog properties. I'm sure the dialog may return real file name not depended on one of predefined
filtersselected.  

MK

23. 7. 2012 v 22:52, "Guillaume Lelarge" <guillaume@lelarge.info>:

> On Mon, 2012-07-23 at 15:20 +0100, Martin French wrote:
>>
>>> I can't replicate this problem. It works for me.
>>> I am running pgAdmin 1.14.2, Windows 7
>>
>> Replicated on 1.14.3, Windows 7 x64.
>>
>>> How to reproduce:
>>> 1. create some text file and save it without suffix - make sure OS
>>> doesn't hide suffixes making you think that there is no suffix in a
>> filename
>>> 2. Open query editor window
>>> 3. Select File / Open...
>>> 4. Enter star character (*) into filename field and commit it
>>> hitting enter - in result you will get all files listed in file
>> browser
>>> 5. find your file
>>> 6. select it and open it - this operation will end up with error:
>>> "can't open file"
>>
>>
>> 1. created file: H:\Postgres Scripts\test
>> 2. opened editor
>> 3. file > open
>> 4. typed *, hit enter
>> 5. found file " test "
>> 6: Brings up:
>>
>> An Error has occurred:
>>
>> Can't open file 'c:\path\test.sql' (error 2: the system cannot find
>> the file specified)
>>
>> note that ".sql" has been appended to the name of my test file.
>> Probably as the file spec is set to *.sql.  If you use the dropdown
>> and select *.*, then it works fine.
>>
>
> There's not much we can do here. We show the standard dialog, and it
> tells us which file the user wants to open. If it tells to open
> "test.sql", we have no way to understand you wanted to open the file
> "test".
>
>
> --
> Guillaume
> http://blog.guillaume.lelarge.info
> http://www.dalibo.com
>


Re: Error opening file without suffix

From
"Martin French"
Date:
<p><tt><font size="2">> <br />> There's not much we can do here. We show the standard dialog, and it<br />>
tellsus which file the user wants to open. If it tells to open<br />> "test.sql", we have no way to understand you
wantedto open the file<br />> "test".<br />> </font></tt><br /><br /><tt><font size="2">I'll pull source and take
alook if I get chance. I think that because the filter is set to "sql", it's assuming that the file has an "sql"
extension,and therefore appends it. A pre-parse of the full file name and comparison against the filter may work here?
Althoughthat's a very large assumption on my part without seeing the code itself!</font></tt><br /><br /><tt><font
size="2">Cheers</font></tt><br/><br /><tt><font size="2">Martin <br /></font></tt><font
face="sans-serif">=============================================Romax Technology Limited Rutherford House Nottingham
Science& Technology Park Nottingham, NG7 2PZ England Telephone numbers: +44 (0)115 951 88 00 (main) For other
officelocations see: http://www.romaxtech.com/Contact ================================= =============== E-mail:
info@romaxtech.comWebsite: www.romaxtech.com ================================= ================ Confidentiality
StatementThis transmission is for the addressee only and contains information that is confidential and privileged.
Unlessyou are the named addressee, or authorised to receive it on behalf of the addressee you may not copy or use it,
ordisclose it to anyone else. If you have received this transmission in error please delete from your system and
contactthe sender. Thank you for your cooperation. =================================================</font> 

Re: Error opening file without suffix

From
Guillaume Lelarge
Date:
On Tue, 2012-07-24 at 07:53 +0100, Martin French wrote:
> > 
> > There's not much we can do here. We show the standard dialog, and it
> > tells us which file the user wants to open. If it tells to open
> > "test.sql", we have no way to understand you wanted to open the file
> > "test".
> > 
> 
> I'll pull source and take a look if I get chance. I think that because
> the filter is set to "sql", it's assuming that the file has an "sql"
> extension, and therefore appends it. A pre-parse of the full file name
> and comparison against the filter may work here? Although that's a
> very large assumption on my part without seeing the code itself!
> 

You sure can get a look at it. And I welcome any patches that would fix
any *actual* issue.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



Re: Error opening file without suffix

From
"Martin French"
Date:
<p><tt><font size="2"><br />> You sure can get a look at it. And I welcome any patches that would fix<br />> any
*actual*issue.<br /></font></tt><br /><tt><font size="2">Ok, If I get chance, I'll take a look.</font></tt><br /><br
/><tt><fontsize="2">Although it's reproducible, I suspect; as I believe you do, that this is a very very minor issue,
ifindeed it is at all.</font></tt><br /><br /><tt><font size="2">Cheers</font></tt><font
face="sans-serif">=============================================Romax Technology Limited Rutherford House Nottingham
Science& Technology Park Nottingham, NG7 2PZ England Telephone numbers: +44 (0)115 951 88 00 (main) For other
officelocations see: http://www.romaxtech.com/Contact ================================= =============== E-mail:
info@romaxtech.comWebsite: www.romaxtech.com ================================= ================ Confidentiality
StatementThis transmission is for the addressee only and contains information that is confidential and privileged.
Unlessyou are the named addressee, or authorised to receive it on behalf of the addressee you may not copy or use it,
ordisclose it to anyone else. If you have received this transmission in error please delete from your system and
contactthe sender. Thank you for your cooperation. =================================================</font>