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 

SplitPath not working as intended ?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ricke



Joined: 14 Sep 2006
Posts: 31

PostPosted: Mon May 07, 2007 10:17 am    Post subject: SplitPath not working as intended ? Reply with quote

place = C:\test\folder1\message.txt
SplitPath, place , OutFileName
msgbox, %OutFilename%


The above returns "message.txt" which is correct.

place = C:\test\folder1
SplitPath, place , OutFileName
msgbox, %OutFilename%


This returns "folder1"..... problem.

This could be a file named "folder1" with no extension.... but in this case it was a folder.... but Splitpath returned it like a file =/

Is there anyway to check if "C:\test\folder1" points to a file or a folder ?

Thought Splitpath would take care of it... but it seems it just split up a string and never actually check to see if it is file or a folder.

help plx =)
Back to top
View user's profile Send private message
Helpy
Guest





PostPosted: Mon May 07, 2007 10:32 am    Post subject: Reply with quote

You guessed right, SplitPath is a string operation, independent of the file system. It can even be used with URLs... Or paths on non-connected drives, and so on.
To check wheter you have a file or a directory, use the FileExist() function.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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