Directory winapi functions

a function that would let me know all the files AND FOLDERS in a direc

Page 1 of 1

4 Replies - 1376 Views - Last Post: 13 January 2010 - 11:54 PM Rate Topic: -----

#1 Manas_4m_BlackDeath   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-January 10

Directory winapi functions

Posted 13 January 2010 - 09:45 AM

Please let me know a function that will let me know all the files and FOLDERS in a directory.......i repeat including the folders....i tried FindFirstFile() and FindNextFile() but ended up getting only files.........not folders.....
Is This A Good Question/Topic? 0
  • +

Replies To: Directory winapi functions

#2 Huzi94   User is offline

  • D.I.C Head
  • member icon

Reputation: 14
  • View blog
  • Posts: 119
  • Joined: 14-November 09

Re: Directory winapi functions

Posted 13 January 2010 - 11:05 AM

Try this snippet:
http://www.dreaminco...snippet2295.htm
You can even use "dirent.h" to get all contents of a folder.
Was This Post Helpful? 0
  • +
  • -

#3 Ancient Dragon   User is offline

  • D.I.C Addict
  • member icon

Reputation: 82
  • View blog
  • Posts: 679
  • Joined: 19-July 09

Re: Directory winapi functions

Posted 13 January 2010 - 12:06 PM

The trick is the path parameter you pass to FindFirstFile(). If you pass *.* then it will get the directories as well as files. Pass anything else and only files/folders that match the pattern will be returned.
Was This Post Helpful? 0
  • +
  • -

#4 Manas_4m_BlackDeath   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-January 10

Re: Directory winapi functions

Posted 13 January 2010 - 11:50 PM

thank y'all..............the trick is enough and useful for me.........don't hav lotta $$$

This post has been edited by Manas_4m_BlackDeath: 13 January 2010 - 11:51 PM

Was This Post Helpful? 0
  • +
  • -

#5 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6968
  • View blog
  • Posts: 31,958
  • Joined: 10-May 07

Re: Directory winapi functions

Posted 13 January 2010 - 11:54 PM

View PostManas_4m_BlackDeath, on 14 Jan, 2010 - 12:50 AM, said:

don't hav lotta $$$

Then you must be in the wrong directory. No amount of Windows API is going to fix this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1