hi_files 0.2.0

hi_files

A simple library for get file-list of local disk.

Usage:

See example.dart.

Class

C_FileList : Get and keep local file list

  Metohds
        void setPath(String path, [List<String> ext])
            path: target path
            ext: target extentions (option)
        int getSync([num Mode])
            Get file list & parameters
            Mode:  1 = print mode for debug
            return: 0 = no error, -1 = Exception, -2 = other error
  Properties
    int filesCount: count of files
    int dirsCount: count of directorie
    List<String> targetExt: for selected file list
      <below are file list properties>
    List<String> filename
    List<String> directory
    List<String> extension
    List<DateTime> timeStamp
    List<int> type: 0 = directory , 1 = file

C_Files class is added options to C_FileList calss.

   Metohds
    int getList(String path, [List<String> ext])
        path: target path
        ext: target extentions (option)
    clear()
        all properties clear from file list
   Properies
    List<String> option: for use in other programs
    List<int> flg: for use in other programs

C_Log : keep log messages and save to local disk.

 constructor
        C_log(String log filename)

 Methods
        void add(String log message)
        int write()
            return: 0 = no error, -1 = Exception, -2 = other error

 Property
        List<String> log
            log messages

Version

0.2.0 Add 'clear' method and 'flg' property.
0.1.1 Add 'option' and 'type' properties.
0.1.0	New Release

example/example.dart

import '../lib/hi_files.dart';
// import 'package:hi_files/hi_files.dart';

main() {
	String path = 'E:\\Users\\Test';

	C_Files dir = new C_Files();
	dir.getList(path);
	print(dir.filesCount.toString() + ' files');
	print(dir.dirsCount.toString() + ' Directories');

	for (int i = 0; i < dir.filename.length; i++ ) {
		switch (dir.type[i]) {
			case 0:
				print('dir:' + dir.directory[i]);
				break;
			case 1:
				print('file:' + dir.filename[i]);
		}
	}

	dir.clear();
	List<String> extensions = ['xml', 'css'];
	dir.getList(path, extensions);
	print ('files:' + dir.filename.length.toString());
	for (int i = 0; i < dir.filename.length; i++) {
		if (dir.type[i] == 1) print(dir.filename[i]);
	}

}

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  hi_files: "^0.2.0"

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support 'pub get'. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:hi_files/hi_files.dart';

Platforms

About

Get local file list. Directiory, Filename, Extension, and Timestamp.

Author

Email hi_tag hi_tag

Homepage

studyhall.webcrow.jp/freesoft/dartfiles.html

Documentation

www.dartdocs.org/documentation/hi_files/0.2.0/

Uploader

hi.tagoo@gmail.com

Published

Mar 30, 2014

Share