AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Really strange, proably bug....

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
DJAnonimo



Joined: 10 Sep 2006
Posts: 145

PostPosted: Tue Mar 25, 2008 1:15 am    Post subject: Really strange, proably bug.... Reply with quote

Hi,

i just found a strange situation, look the code:

Code:
IfExist, con.ini
{
Msgbox con.ini exist? Where?
}
Back to top
View user's profile Send private message MSN Messenger
Rhys



Joined: 17 Apr 2007
Posts: 618
Location: Florida

PostPosted: Tue Mar 25, 2008 1:31 am    Post subject: Reply with quote

MsgBox wrote:
---------------------------
scratch.ahk
---------------------------
con.ini exist? Where?
---------------------------
OK
---------------------------
What are you trying to do?
_________________
Back to top
View user's profile Send private message
DJAnonimo



Joined: 10 Sep 2006
Posts: 145

PostPosted: Tue Mar 25, 2008 1:59 am    Post subject: Reply with quote

hmm, i want to check if the file exist or not.
and it says that the file exist, but it doesn't.

try yourself
Back to top
View user's profile Send private message MSN Messenger
Superfraggle



Joined: 02 Nov 2004
Posts: 753
Location: London, UK

PostPosted: Tue Mar 25, 2008 2:07 am    Post subject: Reply with quote

This works too,

Code:
IfExist, con.sdfsdfsdfsdfsdf
{
Msgbox con.ini exist? Where?
}


It shouldnt :S
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
Fry



Joined: 01 Nov 2007
Posts: 485

PostPosted: Tue Mar 25, 2008 2:17 am    Post subject: Reply with quote

It does this because the con file is alwasy present.
It stands for console

Go to your desktop and make a folder or file with the name of con.

It will say its already there.

Any extension doesnt matter.

So no this is not a bug
_________________
check out my site
www.eliteknifesquad.com

Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2364
Location: Australia, Qld

PostPosted: Tue Mar 25, 2008 3:21 am    Post subject: Reply with quote

Code:
DllCall("AllocConsole")
ifExist nul
    FileAppend, nul exists... o_O`n, con.ini
FileAppend, Press Enter to exit., con.foo
FileReadLine, l, con.rawr!, 1
Laughing

Btw, it's a documented Windows feature: Naming a File.
Quote:
Do not use the following reserved device names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension, for example, NUL.tx7.
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 379
Location: Berlin

PostPosted: Tue Apr 01, 2008 10:19 pm    Post subject: Reply with quote

Code:
DllCall("AllocConsole")
fileappend, test`n, con
FileAppend, Press Enter to exit., con
FileReadLine, l, con, 1

Lexikos, wow thx! You showed me a way how to write console like programs with AutoHotkey. I will search and read more about that. Is the stdin working with con? For example with pipes.
Back to top
View user's profile Send private message Send e-mail
Lexikos



Joined: 17 Oct 2006
Posts: 2364
Location: Australia, Qld

PostPosted: Wed Apr 02, 2008 1:48 am    Post subject: Reply with quote

No, CON, CONIN$ and CONOUT$ access the console, even if StdIn and StdOut have been redirected.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group