Jump to content

Looking for a function

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1
Kylo

Kylo

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
Does anyone know if there's a function that counts how many files are in a directory and then returns the number. And if there is, does it work with internet directories as well?
EDIT:-
I'm guessng then there isn't one, right?

Edited by TcM, 24 April 2008 - 07:31 AM.

Leafly Forums, a place for game designers and players alike.

#2
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
It's different for the local file system and different for the remote one (http or ftp). For ftp you "ask" the server to give you a list of files in a specific directory and then you count them. The reply you get from the server may be in xml format so you will have to make your own function to convert it and take the numbers of the files.

#3
Kylo

Kylo

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
OK, that didn't answer my question at all. I need to know what the function is.
Leafly Forums, a place for game designers and players alike.

#4
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts
This may help you a bit! Or This

#5
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
Neither SMTP or FTP will ever output XML......

CodeGuru Forums - Windows SDK File System: How to count files within a directory and subdirectories?

#6
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
In PHP you can use the readdir() and opendir() functions. I only learnt that recently.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#7
sakishrist

sakishrist

    Programmer

  • Members
  • PipPipPipPip
  • 109 posts

Quote

Neither SMTP or FTP will ever output XML......
In one of my projects in the past it did ... but I think I was using a dll to connect so that must have been the reason.

#8
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
It WAS that reason. I've written clients for both FTP and SMTP/POP, absolutely no xml. XML didn't exist when they we're drafted.