Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

File or directory ?



  • Please log in to reply
2 replies to this topic
homer_simpson
  • Members
  • 40 posts
  • Last active: Jul 11 2014 08:24 AM
  • Joined: 15 Nov 2012

Hello,

how do I understand if a path is a file or a directory?

 

splitpath didn't help:

    splitpath clipboard, filename, directory, extension
    msgbox %clipboard% %directory%
    if clipboard = directory
{...}

because if I give the path of a directory it removes the last name after the \ and therefore returns the parent path...

To check an empty extension would create problems in case of files without extension!

 

Thanks for the help,

Marco



just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
✓  Best Answer

Look at the example at FileExist(), please.


Prefer ahkscript.org for the time being.


homer_simpson
  • Members
  • 40 posts
  • Last active: Jul 11 2014 08:24 AM
  • Joined: 15 Nov 2012

Thank, you it works !!

 

Marco