Raised This Month: $51 Target: $400
 12% 

File Handles !!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-25-2012 , 08:27   File Handles !!
Reply With Quote #1

I have created a folder in AmxModx Directory named "AAA" .

1. How to know how many files are there in this folder ?
2. How to get the names of the files in this folder ?
3. What is the arg "pos" in read_dir native.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 10-25-2012 at 08:28.
Shooting King is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 10-25-2012 , 08:48   Re: File Handles !!
Reply With Quote #2

read the include files.....
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-25-2012 , 08:49   Re: File Handles !!
Reply With Quote #3

If you know Just answer.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-25-2012 , 10:54   Re: File Handles !!
Reply With Quote #4

Answer #1
Answer #2
Answer #3 is given to you on the page you linked to


Though, I would prefer using these functions instead.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-25-2012 , 20:06   Re: File Handles !!
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
Answer #1
Answer #2
Answer #3 is given to you on the page you linked to


Though, I would prefer using these functions instead.
You should have said "Your third question answers your first two" .
__________________
fysiks is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-26-2012 , 03:25   Re: File Handles !!
Reply With Quote #6

Quote:
Originally Posted by YamiKaitou View Post
Answer #1
Answer #2
Answer #3 is given to you on the page you linked to


Though, I would prefer using these functions instead.
Can you give me some example code. I know those file.inc functions but how to use them ??
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-26-2012 , 04:08   Re: File Handles !!
Reply With Quote #7

PHP Code:
#include <amxmisc>
public func(){
    new 
buffer[64], path[128]
    
get_configsdir(pathsizeof(path)-1)
    new 
dirh open_dir(pathbuffersizeof(buffer)-1);
    if(
dirh != 0){
        
log_amx("File list of %s :"path)
        do{
            
log_amx(buffer)
        }while(
next_file(dirhbuffersizeof(buffer)-1))
        
close_dir(dirh)
    }

__________________
Impossible is Nothing
Sylwester is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-29-2012 , 09:55   Re: File Handles !!
Reply With Quote #8

Thanks to Sylwester and other guys for helping me out.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-29-2012 , 13:58   Re: File Handles !!
Reply With Quote #9

Note that open_dir retrives the first file (or subdirectory dunno) of directory.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode