# JsDoc Reference - CeL.application.OS.Windows.file

Class Index | File Index

## Classes

- _global_
- CeL
- CeL.application.debug
- CeL.application.debug.log
- CeL.application.locale
- CeL.application.net
- CeL.application.net.Ajax
- CeL.application.OS.Windows
- CeL.application.OS.Windows.file
- CeL.application.OS.Windows.HTA
- CeL.application.OS.Windows.job
- CeL.application.OS.Windows.registry
- CeL.application.OS.Windows.WMI
- CeL.application.storage.file
- CeL.data
- CeL.data.check
- CeL.data.code.API
- CeL.data.code.compatibility
- CeL.data.code.reorganize
- CeL.data.CSV
- CeL.data.math
- CeL.data.math.Hamming
- CeL.data.math.polynomial
- CeL.data.math.quotient
- CeL.data.native
- CeL.data.XML
- CeL.env
- CeL.interact.DOM
- CeL.interact.form.address
- CeL.interact.form.select_input
- CeL.interact.integrate.map
- CeL.interact.integrate.SVG

# Class CeL.application.OS.Windows.file

Windows 下，檔案操作相關之 function。
Defined in: file.origin.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| CeL.application.OS.Windows.file() null module constructor

Field Summary
Field Attributes | Field Name and Description
--- | ---
<static> <constant> | CeL.application.OS.Windows.file.folder_info.f folder_info 的 flag enumeration
<static> | CeL.application.OS.Windows.file.fso_attributes FileSystemObject Object Attributes Property
<static> | CeL.application.OS.Windows.file.fso_attributes.Alias Link or shortcut.
<static> | CeL.application.OS.Windows.file.fso_attributes.Archive File has changed since last backup.
<static> | CeL.application.OS.Windows.file.fso_attributes.Compressed Compressed file.
<static> | CeL.application.OS.Windows.file.fso_attributes.Directory Folder or directory.
<static> | CeL.application.OS.Windows.file.fso_attributes.Hidden Hidden file.
<static> | CeL.application.OS.Windows.file.fso_attributes.none Default.
<static> | CeL.application.OS.Windows.file.fso_attributes.Normal Normal file.
<static> | CeL.application.OS.Windows.file.fso_attributes.ReadOnly Read-only file.
<static> | CeL.application.OS.Windows.file.fso_attributes.System System file.
<static> | CeL.application.OS.Windows.file.fso_attributes.Volume Disk drive volume label.
<static> | CeL.application.OS.Windows.file.iomode FileSystemObject Object I/O mode enumeration
<static> | CeL.application.OS.Windows.file.iomode.ForAppending Open a file and write to the end of the file.
<static> | CeL.application.OS.Windows.file.iomode.ForReading Open a file for reading only.
<static> | CeL.application.OS.Windows.file.iomode.ForWriting Open a file for writing.
<static> <constant> | CeL.application.OS.Windows.file.move_file.f move_file 的 flag enumeration
<static> | CeL.application.OS.Windows.file.move_file.f.copy copy, instead of move the file
<static> | CeL.application.OS.Windows.file.move_file.f.fuzzy If source don't exist but target exist, than reverse.
<static> | CeL.application.OS.Windows.file.move_file.f.include_folder include folder
<static> | CeL.application.OS.Windows.file.move_file.f.include_subfolder include sub-folder
<static> | CeL.application.OS.Windows.file.move_file.f.none null flag
<static> | CeL.application.OS.Windows.file.move_file.f.overwrite overwrite target
<static> | CeL.application.OS.Windows.file.move_file.f.remove 當 target 指定此 flag，或包含此 flag 而未指定 target 時，remove the source。
<static> | CeL.application.OS.Windows.file.move_file.f.reverse reverse source and target
<static> | CeL.application.OS.Windows.file.move_file.f.Test Just do a test
<static> | CeL.application.OS.Windows.file.open_format FileSystemObject Object file open format enumeration
<static> | CeL.application.OS.Windows.file.open_format.TristateFalse Opens the file as ASCII.
<static> | CeL.application.OS.Windows.file.open_format.TristateTrue Opens the file as Unicode.
<static> | CeL.application.OS.Windows.file.open_format.TristateUseDefault Opens the file using the system default.
<static> <constant> | CeL.application.OS.Windows.file.traverse_file_system.f traverse_file_system 的 flag enumeration
<private> <static> | CeL.application.OS.Windows.file.traverse_file_system.f.driver 用於指示 driver
<private> <static> | CeL.application.OS.Windows.file.traverse_file_system.f.file 用於指示 file
<private> <static> | CeL.application.OS.Windows.file.traverse_file_system.f.folder 用於指示 folder
<private> <static> | CeL.application.OS.Windows.file.traverse_file_system.f.func_length handle function 應有的長度
<static> | CeL.application.OS.Windows.file.traverse_file_system.f.get_object return object
<static> | CeL.application.OS.Windows.file.traverse_file_system.f.no_traverse 不深入下層子目錄及檔案
<private> <static> | CeL.application.OS.Windows.file.traverse_file_system.f.NULL null flag
<static> | CeL.application.OS.Windows.file.traverse_file_system.f.traverse 深入下層子目錄及檔案

Method Summary
Method Attributes | Method Name and Description
--- | ---
<static> | CeL.application.OS.Windows.file.Ado_binary(data, pos) 轉換以 adTypeBinary 讀到的資料
<private> <static> | CeL.application.OS.Windows.file.Ado_binary#newDOM()
<private> <static> | CeL.application.OS.Windows.file.Ado_binary#newFS(FP)
<private> <static> | CeL.application.OS.Windows.file.Ado_binary#readData(len) read data
<static> | CeL.application.OS.Windows.file.Ado_binary#renew() 實際上沒多大效用。實用解決法：少用 AdoStream.Write()
<static> | CeL.application.OS.Windows.file.Ado_binary#setData(data, pos) 設定 data
<static> | CeL.application.OS.Windows.file.change_attributes(F, A) 改變檔案之屬性。 chmod @ UNIX
<static> | CeL.application.OS.Windows.file.folder_info(folder_path, file_filter, traverseSubDirectory) Get the infomation of folder
<static> | CeL.application.OS.Windows.file.get_file_details(fileObj, parentDirObj) get file details (readonly)
<static> | CeL.application.OS.Windows.file.iconv_file(fileName, toCode, fromCode, encodeFunction) 將編碼為fromCode之檔案fileName中所有不合編碼toCode之char以encodeFunction轉換
<static> | CeL.application.OS.Windows.file.move_1_file(from, to, dir, only_filename, reverse) move file
<static> | CeL.application.OS.Windows.file.move_file(from, to, base_path, flag, filter) move/rename files, ** use RegExp, but no global flag ** 可用 move_file_filter() 來排除不要的 本函數可能暫時改變目前工作目錄！
<static> | CeL.application.OS.Windows.file.open_file(FN, format, io_mode) 提供給 read_file, write_file 使用的簡易開檔函數
<static> | CeL.application.OS.Windows.file.openDataTest(FN, NOTexist, io_mode) 開檔處理 測試是否已開啟資料檔之測試與重新開啟資料檔
<static> | CeL.application.OS.Windows.file.read_file(FN, format, io_mode, func) 讀取檔案
<static> | CeL.application.OS.Windows.file.translate_AdoStream_binary_data(data, len, type) 轉換以 adTypeBinary 讀到的資料
<static> | CeL.application.OS.Windows.file.traverse_file_system(FS_function_array, path, filter, flag) 巡覽 file system 的公用函數
<static> | CeL.application.OS.Windows.file.write_file(FN, content, format, io_mode, N_O) 將 content 寫入 file ** ADODB.Stream does not support appending!

Class Detail
CeL.application.OS.Windows.file()
null module constructor
Field Detail
<static> <constant> CeL.application.OS.Windows.file.folder_info.f
folder_info 的 flag enumeration

<static> CeL.application.OS.Windows.file.fso_attributes
FileSystemObject Object Attributes Property

Since:
  2010/1/9 08:33:36

See:
  Attributes Property

<static> CeL.application.OS.Windows.file.fso_attributes.Alias
Link or shortcut. Attribute is read-only.

<static> CeL.application.OS.Windows.file.fso_attributes.Archive
File has changed since last backup. Attribute is read/write.

<static> CeL.application.OS.Windows.file.fso_attributes.Compressed
Compressed file. Attribute is read-only.

<static> CeL.application.OS.Windows.file.fso_attributes.Directory
Folder or directory. Attribute is read-only.

<static> CeL.application.OS.Windows.file.fso_attributes.Hidden
Hidden file. Attribute is read/write.

<static> CeL.application.OS.Windows.file.fso_attributes.none
Default. No attributes are set.

<static> CeL.application.OS.Windows.file.fso_attributes.Normal
Normal file. No attributes are set.

<static> CeL.application.OS.Windows.file.fso_attributes.ReadOnly
Read-only file. Attribute is read/write.

<static> CeL.application.OS.Windows.file.fso_attributes.System
System file. Attribute is read/write.

<static> CeL.application.OS.Windows.file.fso_attributes.Volume
Disk drive volume label. Attribute is read-only.

<static> CeL.application.OS.Windows.file.iomode
FileSystemObject Object I/O mode enumeration

See:
  OpenTextFile Method

<static> CeL.application.OS.Windows.file.iomode.ForAppending
Open a file and write to the end of the file.

<static> CeL.application.OS.Windows.file.iomode.ForReading
Open a file for reading only. You can't write to this file.

<static> CeL.application.OS.Windows.file.iomode.ForWriting
Open a file for writing.

<static> <constant> CeL.application.OS.Windows.file.move_file.f
move_file 的 flag enumeration

<static> CeL.application.OS.Windows.file.move_file.f.copy
copy, instead of move the file

<static> CeL.application.OS.Windows.file.move_file.f.fuzzy
If source don't exist but target exist, than reverse.

Deprecated:
TODO

<static> CeL.application.OS.Windows.file.move_file.f.include_folder
include folder

<static> CeL.application.OS.Windows.file.move_file.f.include_subfolder
include sub-folder

<static> CeL.application.OS.Windows.file.move_file.f.none
null flag

<static> CeL.application.OS.Windows.file.move_file.f.overwrite
overwrite target

<static> CeL.application.OS.Windows.file.move_file.f.remove
當 target 指定此 flag，或包含此 flag 而未指定 target 時，remove the source。

<static> CeL.application.OS.Windows.file.move_file.f.reverse
reverse source and target

<static> CeL.application.OS.Windows.file.move_file.f.Test
Just do a test

<static> CeL.application.OS.Windows.file.open_format
FileSystemObject Object file open format enumeration

See:
  OpenTextFile Method

<static> CeL.application.OS.Windows.file.open_format.TristateFalse
Opens the file as ASCII.

<static> CeL.application.OS.Windows.file.open_format.TristateTrue
Opens the file as Unicode.

<static> CeL.application.OS.Windows.file.open_format.TristateUseDefault
Opens the file using the system default.

<static> <constant> CeL.application.OS.Windows.file.traverse_file_system.f
traverse_file_system 的 flag enumeration

<private> <static> CeL.application.OS.Windows.file.traverse_file_system.f.driver
用於指示 driver

<private> <static> CeL.application.OS.Windows.file.traverse_file_system.f.file
用於指示 file

<private> <static> CeL.application.OS.Windows.file.traverse_file_system.f.folder
用於指示 folder

<private> <static> CeL.application.OS.Windows.file.traverse_file_system.f.func_length
handle function 應有的長度

<static> CeL.application.OS.Windows.file.traverse_file_system.f.get_object
return object

<static> CeL.application.OS.Windows.file.traverse_file_system.f.no_traverse
不深入下層子目錄及檔案

<private> <static> CeL.application.OS.Windows.file.traverse_file_system.f.NULL
null flag

<static> CeL.application.OS.Windows.file.traverse_file_system.f.traverse
深入下層子目錄及檔案
Method Detail
<static> CeL.application.OS.Windows.file.Ado_binary(data, pos)
轉換以 adTypeBinary 讀到的資料

Parameters:
data
  以 adTypeBinary 讀到的資料
pos
  position

Since:
  2007/9/19 20:58:26

<private> <static> CeL.application.OS.Windows.file.Ado_binary#newDOM()

Returns:

<private> <static> CeL.application.OS.Windows.file.Ado_binary#newFS(FP)

Parameters:
FP

Returns:

<private> <static> CeL.application.OS.Windows.file.Ado_binary#readData(len)
read data

Parameters:
len
  length

Returns:

<static> CeL.application.OS.Windows.file.Ado_binary#renew()
實際上沒多大效用。實用解決法：少用 AdoStream.Write()

Returns:

<static> CeL.application.OS.Windows.file.Ado_binary#setData(data, pos)
設定 data

Parameters:
data
  binary data
pos

Returns:

<static> CeL.application.OS.Windows.file.change_attributes(F, A)
改變檔案之屬性。 chmod @ UNIX

    change_attributes(path,'-ReadOnly');

Parameters:
F
  file path
A
  attributes, 屬性

<static> CeL.application.OS.Windows.file.folder_info(folder_path, file_filter, traverseSubDirectory)
Get the infomation of folder

    var finfo=new folder_info(path or folder object,extFilter,0/1);

Parameters:
folder_path
  folder path
file_filter
traverseSubDirectory

Deprecated:
以 traverse_file_system 代替

Returns:

<static> CeL.application.OS.Windows.file.get_file_details(fileObj, parentDirObj)
get file details (readonly)

    get_file_details('path');
    get_file_details('file/folder name',parentDir);
    get_file_details('path',get_file_details_get_object);

Parameters:
fileObj
parentDirObj

See:
  GetDetailsOf Method (Folder)

<static> CeL.application.OS.Windows.file.iconv_file(fileName, toCode, fromCode, encodeFunction)
將編碼為fromCode之檔案fileName中所有不合編碼toCode之char以encodeFunction轉換

Parameters:
fileName
toCode
fromCode
encodeFunction

Returns:

<static> CeL.application.OS.Windows.file.move_1_file(from, to, dir, only_filename, reverse)
move file

Parameters:
from
to
dir
only_filename
reverse

Requires:
  fso,get_folder,get_file_name,initWScriptObj

<static> {Object} CeL.application.OS.Windows.file.move_file(from, to, base_path, flag, filter)
move/rename files, ** use RegExp, but no global flag **
可用 move_file_filter() 來排除不要的
本函數可能暫時改變目前工作目錄！

Parameters:
{String} from
  from file
{String} to
  to file
{String} base_path
  base path
flag
{Function} filter
  可用 filter() 來排除不要的

Since:
  2004/4/12 17:25

Returns:
  {Object} report

Requires:
  path_separator,fso,WshShell,new_line,Enumerator

<static> CeL.application.OS.Windows.file.open_file(FN, format, io_mode)
提供給 read_file, write_file 使用的簡易開檔函數

Parameters:
FN
  file path
format
  open format, e.g., open_format.TristateUseDefault
io_mode
  open mode, e.g., iomode.ForWriting

<static> CeL.application.OS.Windows.file.openDataTest(FN, NOTexist, io_mode)
開檔處理
測試是否已開啟資料檔之測試與重新開啟資料檔

Parameters:
FN
  file name
NOTexist
  if NOT need exist
io_mode
  IO mode

Returns:

Requires:
  fso,WshShell,iomode

<static> {String} CeL.application.OS.Windows.file.read_file(FN, format, io_mode, func)
讀取檔案

Parameters:
FN
  file path
format
  open encode = simpleFileDformat
io_mode
  open IO mode = ForReading
func
  do this function per line, or [func, maxsize] (TODO)

Returns:
  {String} 檔案內容

<static> CeL.application.OS.Windows.file.translate_AdoStream_binary_data(data, len, type)
轉換以 adTypeBinary 讀到的資料

    //	較安全的讀檔：
    t=translate_AdoStream_binary_data(read_file(FP,'binary'));
    write_file(FP,t,'iso-8859-1');

Parameters:
data
len
type

See:
  Hawk's W3 Laboratory : Disposable WSH : 番外編：文字エンコーディングとADODB.Stream

<static> CeL.application.OS.Windows.file.traverse_file_system(FS_function_array, path, filter, flag)
巡覽 file system 的公用函數

Parameters:
FS_function_array
  file system handle function array
path
  target path
filter
  filter
flag
  see flag

Returns:

See:
  FileSystemObject

<static> CeL.application.OS.Windows.file.write_file(FN, content, format, io_mode, N_O)
將 content 寫入 file ** ADODB.Stream does not support appending!

Parameters:
FN
  file path
content
  content to write
format
  open format = simpleFileDformat
io_mode
  write mode = ForWriting, e.g., ForAppending
N_O
  DO NOT overwrite

Returns:
  error No.

Documentation generated by JsDoc Toolkit 2.4.0 on Sat Aug 20 2011 15:07:29 GMT+0800 (CST)