Top

List files


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Sep 12, 2007
Last Updated  Sep 12, 2007

Introduction

Lists files in a specified directory in a new @window.

Usage:

/dirlist_ (directory) list (txtfiles,inifiles,(or enter a type of file using the format: .dat [as an example].))



Grab the Code

alias dirlist_ { 
  var %x = $1
  if ($2 iswm list) { 
    if (!$window(@files)) { window -lk @files }
    if ($3 iswm txtfiles) { 
      var %c = $findfile(%x,*.txt,0,aline -p @files $1-) 
      return %c 
    } 
    if ($3 iswm inifiles) { 
      var %c = $findfile(%x,*.ini,0,aline -p @files $1-) 
      return %c 
    }
    else { 
      var %c = $findfile(%x,$+(*.,$3),0,aline -p @files $1-) 
      return %c 
    }
  }
}
menu @files { 
  dclick:run $gettok($sline($active, 1),1-,32)
}
 

Comments

  (7)  RSS
kerstt
Comments: 63
 
mIRC Snippet:  List files
Posted on Sep 12, 2007 2:44 pm
Quote:
$isdir(dirname)

Returns $true if the specified directory exists, otherwise $false.

dataprofile
Comments: 43
 
mIRC Snippet:  List files
Posted on Sep 12, 2007 2:56 pm
Yes it does. On the contrary, this snippet returns the file in a specified directory. That covers if the directory is true. As said in the intro, this is a more advanced version of $findfile.
xDaeMoN
Comments: 695
 
mIRC Snippet:  List files
Posted on Sep 12, 2007 2:57 pm
Also, there is $isfile and $exists.
dataprofile
Comments: 43
 
mIRC Snippet:  List files
Posted on Sep 12, 2007 3:07 pm
Alrighty, I edited the snippet.I just decided to make it a file list. Thank you xDaeMoN and kerstt for your feedback.
dataprofile
Comments: 43
 
mIRC Snippet:  List files
Posted on Sep 12, 2007 5:18 pm
*updated:

added the option to run the selected file on a double-click
simplicity
Comments: 17
 
mIRC Snippet:  List files
Posted on Sep 14, 2007 5:43 pm
Effective and clean. On the contrary, it's pretty simple. I recommend adding the option to delete the file. /remove should do the trick. I probably would give this a 5/10 if I had the option to rate snippets.

dataprofile
Comments: 43
 
mIRC Snippet:  List files
Posted on Sep 14, 2007 6:18 pm
Thanks simplicity I'll add the option.

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom