1 /* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 var fs = require('fs');
18 var assert = require('assert');
21 var stats1 = fs.statSync('test_fs_stat.js');
22 assert.equal(stats1.isFile(), true);
23 assert.equal(stats1.isDirectory(), false);
25 fs.stat('test_fs_stat.js', function(err, stats) {
27 assert.equal(stats.isFile(), true);
28 assert.equal(stats.isDirectory(), false);
36 var stats2 = fs.statSync('../resources');
37 assert.equal(stats2.isDirectory(), true);
38 assert.equal(stats2.isFile(), false);
40 fs.stat('../resources', function(err, stats) {
42 assert.equal(stats.isDirectory(), true);
43 assert.equal(stats.isFile(), false);