Lines Matching refs:args

254 void FileHandle::New(const FunctionCallbackInfo<Value>& args) {
255 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
257 CHECK(args.IsConstructCall());
258 CHECK(args[0]->IsInt32());
261 FileHandle::New(binding_data, args[0].As<Int32>()->Value(), args.This());
263 if (args[1]->IsNumber())
264 handle->read_offset_ = args[1]->IntegerValue(env->context()).FromJust();
265 if (args[2]->IsNumber())
266 handle->read_length_ = args[2]->IntegerValue(env->context()).FromJust();
493 void FileHandle::Close(const FunctionCallbackInfo<Value>& args) {
495 ASSIGN_OR_RETURN_UNWRAP(&fd, args.Holder());
498 args.GetReturnValue().Set(ret);
502 void FileHandle::ReleaseFD(const FunctionCallbackInfo<Value>& args) {
504 ASSIGN_OR_RETURN_UNWRAP(&fd, args.Holder());
704 void FSReqCallback::SetReturnValue(const FunctionCallbackInfo<Value>& args) {
705 args.GetReturnValue().SetUndefined();
708 void NewFSReqCallback(const FunctionCallbackInfo<Value>& args) {
709 CHECK(args.IsConstructCall());
710 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
711 new FSReqCallback(binding_data, args.This(), args[0]->IsTrue());
945 void Access(const FunctionCallbackInfo<Value>& args) {
946 Environment* env = Environment::GetCurrent(args);
950 const int argc = args.Length();
953 CHECK(args[1]->IsInt32());
954 int mode = args[1].As<Int32>()->Value();
956 BufferValue path(isolate, args[0]);
959 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
963 AsyncCall(env, req_wrap_async, args, "access", UTF8, AfterNoArgs,
969 SyncCall(env, args[3], &req_wrap_sync, "access", uv_fs_access, *path, mode);
975 void Close(const FunctionCallbackInfo<Value>& args) {
976 Environment* env = Environment::GetCurrent(args);
978 const int argc = args.Length();
981 CHECK(args[0]->IsInt32());
982 int fd = args[0].As<Int32>()->Value();
985 FSReqBase* req_wrap_async = GetReqWrap(args, 1);
988 AsyncCall(env, req_wrap_async, args, "close", UTF8, AfterNoArgs,
994 SyncCall(env, args[2], &req_wrap_sync, "close", uv_fs_close, fd);
1001 static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) {
1002 Environment* env = Environment::GetCurrent(args);
1006 CHECK(args[0]->IsString());
1007 node::Utf8Value path(isolate, args[0]);
1010 args.GetReturnValue().Set(Array::New(isolate));
1018 args.GetReturnValue().Set(Array::New(isolate));
1045 args.GetReturnValue().Set(Array::New(isolate));
1091 args.GetReturnValue().Set(
1098 static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
1099 Environment* env = Environment::GetCurrent(args);
1101 CHECK(args[0]->IsString());
1102 node::Utf8Value path(env->isolate(), args[0]);
1112 args.GetReturnValue().Set(rc);
1115 static void Stat(const FunctionCallbackInfo<Value>& args) {
1116 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
1119 const int argc = args.Length();
1122 BufferValue path(env->isolate(), args[0]);
1125 bool use_bigint = args[1]->IsTrue();
1126 FSReqBase* req_wrap_async = GetReqWrap(args, 2, use_bigint);
1130 AsyncCall(env, req_wrap_async, args, "stat", UTF8, AfterStat,
1136 int err = SyncCall(env, args[3], &req_wrap_sync, "stat", uv_fs_stat, *path);
1144 args.GetReturnValue().Set(arr);
1148 static void LStat(const FunctionCallbackInfo<Value>& args) {
1149 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
1152 const int argc = args.Length();
1155 BufferValue path(env->isolate(), args[0]);
1158 bool use_bigint = args[1]->IsTrue();
1159 FSReqBase* req_wrap_async = GetReqWrap(args, 2, use_bigint);
1163 AsyncCall(env, req_wrap_async, args, "lstat", UTF8, AfterStat,
1169 int err = SyncCall(env, args[3], &req_wrap_sync, "lstat", uv_fs_lstat,
1178 args.GetReturnValue().Set(arr);
1182 static void FStat(const FunctionCallbackInfo<Value>& args) {
1183 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
1186 const int argc = args.Length();
1189 CHECK(args[0]->IsInt32());
1190 int fd = args[0].As<Int32>()->Value();
1192 bool use_bigint = args[1]->IsTrue();
1193 FSReqBase* req_wrap_async = GetReqWrap(args, 2, use_bigint);
1196 AsyncCall(env, req_wrap_async, args, "fstat", UTF8, AfterStat,
1202 int err = SyncCall(env, args[3], &req_wrap_sync, "fstat", uv_fs_fstat, fd);
1210 args.GetReturnValue().Set(arr);
1214 static void StatFs(const FunctionCallbackInfo<Value>& args) {
1215 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
1218 const int argc = args.Length();
1221 BufferValue path(env->isolate(), args[0]);
1224 bool use_bigint = args[1]->IsTrue();
1225 FSReqBase* req_wrap_async = GetReqWrap(args, 2, use_bigint);
1231 args,
1242 SyncCall(env, args[3], &req_wrap_sync, "statfs", uv_fs_statfs, *path);
1252 args.GetReturnValue().Set(arr);
1256 static void Symlink(const FunctionCallbackInfo<Value>& args) {
1257 Environment* env = Environment::GetCurrent(args);
1260 const int argc = args.Length();
1263 BufferValue target(isolate, args[0]);
1265 BufferValue path(isolate, args[1]);
1268 CHECK(args[2]->IsInt32());
1269 int flags = args[2].As<Int32>()->Value();
1271 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
1279 AsyncDestCall(env, req_wrap_async, args, "symlink", *path, path.length(),
1285 SyncCall(env, args[4], &req_wrap_sync, "symlink",
1291 static void Link(const FunctionCallbackInfo<Value>& args) {
1292 Environment* env = Environment::GetCurrent(args);
1295 const int argc = args.Length();
1298 BufferValue src(isolate, args[0]);
1301 BufferValue dest(isolate, args[1]);
1304 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
1312 AsyncDestCall(env, req_wrap_async, args, "link", *dest, dest.length(), UTF8,
1318 SyncCall(env, args[3], &req_wrap_sync, "link",
1324 static void ReadLink(const FunctionCallbackInfo<Value>& args) {
1325 Environment* env = Environment::GetCurrent(args);
1328 const int argc = args.Length();
1331 BufferValue path(isolate, args[0]);
1334 const enum encoding encoding = ParseEncoding(isolate, args[1], UTF8);
1336 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
1340 AsyncCall(env, req_wrap_async, args, "readlink", encoding, AfterStringPtr,
1346 int err = SyncCall(env, args[3], &req_wrap_sync, "readlink",
1360 Local<Object> ctx = args[3].As<Object>();
1365 args.GetReturnValue().Set(rc.ToLocalChecked());
1369 static void Rename(const FunctionCallbackInfo<Value>& args) {
1370 Environment* env = Environment::GetCurrent(args);
1373 const int argc = args.Length();
1376 BufferValue old_path(isolate, args[0]);
1378 BufferValue new_path(isolate, args[1]);
1381 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
1389 AsyncDestCall(env, req_wrap_async, args, "rename", *new_path,
1396 SyncCall(env, args[3], &req_wrap_sync, "rename", uv_fs_rename,
1402 static void FTruncate(const FunctionCallbackInfo<Value>& args) {
1403 Environment* env = Environment::GetCurrent(args);
1405 const int argc = args.Length();
1408 CHECK(args[0]->IsInt32());
1409 const int fd = args[0].As<Int32>()->Value();
1411 CHECK(IsSafeJsInt(args[1]));
1412 const int64_t len = args[1].As<Integer>()->Value();
1414 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
1417 AsyncCall(env, req_wrap_async, args, "ftruncate", UTF8, AfterNoArgs,
1423 SyncCall(env, args[3], &req_wrap_sync, "ftruncate", uv_fs_ftruncate, fd,
1429 static void Fdatasync(const FunctionCallbackInfo<Value>& args) {
1430 Environment* env = Environment::GetCurrent(args);
1432 const int argc = args.Length();
1435 CHECK(args[0]->IsInt32());
1436 const int fd = args[0].As<Int32>()->Value();
1438 FSReqBase* req_wrap_async = GetReqWrap(args, 1);
1441 AsyncCall(env, req_wrap_async, args, "fdatasync", UTF8, AfterNoArgs,
1447 SyncCall(env, args[2], &req_wrap_sync, "fdatasync", uv_fs_fdatasync, fd);
1452 static void Fsync(const FunctionCallbackInfo<Value>& args) {
1453 Environment* env = Environment::GetCurrent(args);
1455 const int argc = args.Length();
1458 CHECK(args[0]->IsInt32());
1459 const int fd = args[0].As<Int32>()->Value();
1461 FSReqBase* req_wrap_async = GetReqWrap(args, 1);
1464 AsyncCall(env, req_wrap_async, args, "fsync", UTF8, AfterNoArgs,
1470 SyncCall(env, args[2], &req_wrap_sync, "fsync", uv_fs_fsync, fd);
1475 static void Unlink(const FunctionCallbackInfo<Value>& args) {
1476 Environment* env = Environment::GetCurrent(args);
1478 const int argc = args.Length();
1481 BufferValue path(env->isolate(), args[0]);
1484 FSReqBase* req_wrap_async = GetReqWrap(args, 1);
1488 AsyncCall(env, req_wrap_async, args, "unlink", UTF8, AfterNoArgs,
1494 SyncCall(env, args[2], &req_wrap_sync, "unlink", uv_fs_unlink, *path);
1499 static void RMDir(const FunctionCallbackInfo<Value>& args) {
1500 Environment* env = Environment::GetCurrent(args);
1502 const int argc = args.Length();
1505 BufferValue path(env->isolate(), args[0]);
1508 FSReqBase* req_wrap_async = GetReqWrap(args, 1); // rmdir(path, req)
1512 AsyncCall(env, req_wrap_async, args, "rmdir", UTF8, AfterNoArgs,
1518 SyncCall(env, args[2], &req_wrap_sync, "rmdir",
1687 int CallMKDirpSync(Environment* env, const FunctionCallbackInfo<Value>& args,
1694 v8::Local<v8::Object> ctx_obj = args[4].As<v8::Object>();
1706 static void MKDir(const FunctionCallbackInfo<Value>& args) {
1707 Environment* env = Environment::GetCurrent(args);
1709 const int argc = args.Length();
1712 BufferValue path(env->isolate(), args[0]);
1715 CHECK(args[1]->IsInt32());
1716 const int mode = args[1].As<Int32>()->Value();
1718 CHECK(args[2]->IsBoolean());
1719 bool mkdirp = args[2]->IsTrue();
1721 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
1725 AsyncCall(env, req_wrap_async, args, "mkdir", UTF8,
1733 int err = CallMKDirpSync(env, args, &req_wrap_sync, *path, mode);
1743 Local<Object> ctx = args[4].As<Object>();
1747 args.GetReturnValue().Set(path.ToLocalChecked());
1750 SyncCall(env, args[4], &req_wrap_sync, "mkdir",
1757 static void RealPath(const FunctionCallbackInfo<Value>& args) {
1758 Environment* env = Environment::GetCurrent(args);
1761 const int argc = args.Length();
1764 BufferValue path(isolate, args[0]);
1767 const enum encoding encoding = ParseEncoding(isolate, args[1], UTF8);
1769 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
1773 AsyncCall(env, req_wrap_async, args, "realpath", encoding, AfterStringPtr,
1779 int err = SyncCall(env, args[3], &req_wrap_sync, "realpath",
1794 Local<Object> ctx = args[3].As<Object>();
1799 args.GetReturnValue().Set(rc.ToLocalChecked());
1803 static void ReadDir(const FunctionCallbackInfo<Value>& args) {
1804 Environment* env = Environment::GetCurrent(args);
1807 const int argc = args.Length();
1810 BufferValue path(isolate, args[0]);
1813 const enum encoding encoding = ParseEncoding(isolate, args[1], UTF8);
1815 bool with_types = args[2]->IsTrue();
1817 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
1824 args,
1835 int err = SyncCall(env, args[4], &req_wrap_sync, "scandir",
1854 Local<Object> ctx = args[4].As<Object>();
1869 Local<Object> ctx = args[4].As<Object>();
1888 args.GetReturnValue().Set(Array::New(isolate, result, arraysize(result)));
1890 args.GetReturnValue().Set(names);
1895 static void Open(const FunctionCallbackInfo<Value>& args) {
1896 Environment* env = Environment::GetCurrent(args);
1898 const int argc = args.Length();
1901 BufferValue path(env->isolate(), args[0]);
1904 CHECK(args[1]->IsInt32());
1905 const int flags = args[1].As<Int32>()->Value();
1907 CHECK(args[2]->IsInt32());
1908 const int mode = args[2].As<Int32>()->Value();
1910 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
1915 AsyncCall(env, req_wrap_async, args, "open", UTF8, AfterInteger,
1921 int result = SyncCall(env, args[4], &req_wrap_sync, "open",
1925 args.GetReturnValue().Set(result);
1929 static void OpenFileHandle(const FunctionCallbackInfo<Value>& args) {
1930 BindingData* binding_data = Realm::GetBindingData<BindingData>(args);
1934 const int argc = args.Length();
1937 BufferValue path(isolate, args[0]);
1940 CHECK(args[1]->IsInt32());
1941 const int flags = args[1].As<Int32>()->Value();
1943 CHECK(args[2]->IsInt32());
1944 const int mode = args[2].As<Int32>()->Value();
1946 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
1950 AsyncCall(env, req_wrap_async, args, "open", UTF8, AfterOpenFileHandle,
1956 int result = SyncCall(env, args[4], &req_wrap_sync, "open",
1964 args.GetReturnValue().Set(fd->object());
1968 static void CopyFile(const FunctionCallbackInfo<Value>& args) {
1969 Environment* env = Environment::GetCurrent(args);
1972 const int argc = args.Length();
1975 BufferValue src(isolate, args[0]);
1978 BufferValue dest(isolate, args[1]);
1981 CHECK(args[2]->IsInt32());
1982 const int flags = args[2].As<Int32>()->Value();
1984 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
1992 AsyncDestCall(env, req_wrap_async, args, "copyfile",
1999 SyncCall(env, args[4], &req_wrap_sync, "copyfile",
2015 static void WriteBuffer(const FunctionCallbackInfo<Value>& args) {
2016 Environment* env = Environment::GetCurrent(args);
2018 const int argc = args.Length();
2021 CHECK(args[0]->IsInt32());
2022 const int fd = args[0].As<Int32>()->Value();
2024 CHECK(Buffer::HasInstance(args[1]));
2025 Local<Object> buffer_obj = args[1].As<Object>();
2029 CHECK(IsSafeJsInt(args[2]));
2030 const int64_t off_64 = args[2].As<Integer>()->Value();
2035 CHECK(args[3]->IsInt32());
2036 const size_t len = static_cast<size_t>(args[3].As<Int32>()->Value());
2041 const int64_t pos = GetOffset(args[4]);
2046 FSReqBase* req_wrap_async = GetReqWrap(args, 5);
2049 AsyncCall(env, req_wrap_async, args, "write", UTF8, AfterInteger,
2055 int bytesWritten = SyncCall(env, args[6], &req_wrap_sync, "write",
2058 args.GetReturnValue().Set(bytesWritten);
2070 static void WriteBuffers(const FunctionCallbackInfo<Value>& args) {
2071 Environment* env = Environment::GetCurrent(args);
2073 const int argc = args.Length();
2076 CHECK(args[0]->IsInt32());
2077 const int fd = args[0].As<Int32>()->Value();
2079 CHECK(args[1]->IsArray());
2080 Local<Array> chunks = args[1].As<Array>();
2082 int64_t pos = GetOffset(args[2]);
2092 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2095 AsyncCall(env, req_wrap_async, args, "write", UTF8, AfterInteger,
2101 int bytesWritten = SyncCall(env, args[4], &req_wrap_sync, "write",
2104 args.GetReturnValue().Set(bytesWritten);
2117 static void WriteString(const FunctionCallbackInfo<Value>& args) {
2118 Environment* env = Environment::GetCurrent(args);
2121 const int argc = args.Length();
2124 CHECK(args[0]->IsInt32());
2125 const int fd = args[0].As<Int32>()->Value();
2127 const int64_t pos = GetOffset(args[2]);
2129 const auto enc = ParseEncoding(isolate, args[3], UTF8);
2131 Local<Value> value = args[1];
2135 FSReqBase* req_wrap_async = GetReqWrap(args, 4);
2165 len = StringBytes::Write(isolate, *stack_buffer, len, args[1], enc);
2182 req_wrap_async->SetReturnValue(args);
2195 len, args[1], enc);
2201 int bytesWritten = SyncCall(env, args[5], &req_wrap_sync, "write",
2204 args.GetReturnValue().Set(bytesWritten);
2220 static void Read(const FunctionCallbackInfo<Value>& args) {
2221 Environment* env = Environment::GetCurrent(args);
2223 const int argc = args.Length();
2226 CHECK(args[0]->IsInt32());
2227 const int fd = args[0].As<Int32>()->Value();
2229 CHECK(Buffer::HasInstance(args[1]));
2230 Local<Object> buffer_obj = args[1].As<Object>();
2234 CHECK(IsSafeJsInt(args[2]));
2235 const int64_t off_64 = args[2].As<Integer>()->Value();
2240 CHECK(args[3]->IsInt32());
2241 const size_t len = static_cast<size_t>(args[3].As<Int32>()->Value());
2244 CHECK(IsSafeJsInt(args[4]) || args[4]->IsBigInt());
2245 const int64_t pos = args[4]->IsNumber() ?
2246 args[4].As<Integer>()->Value() :
2247 args[4].As<BigInt>()->Int64Value();
2252 FSReqBase* req_wrap_async = GetReqWrap(args, 5);
2255 AsyncCall(env, req_wrap_async, args, "read", UTF8, AfterInteger,
2261 const int bytesRead = SyncCall(env, args[6], &req_wrap_sync, "read",
2264 args.GetReturnValue().Set(bytesRead);
2276 static void ReadBuffers(const FunctionCallbackInfo<Value>& args) {
2277 Environment* env = Environment::GetCurrent(args);
2279 const int argc = args.Length();
2282 CHECK(args[0]->IsInt32());
2283 const int fd = args[0].As<Int32>()->Value();
2285 CHECK(args[1]->IsArray());
2286 Local<Array> buffers = args[1].As<Array>();
2288 int64_t pos = GetOffset(args[2]); // -1 if not a valid JS int
2299 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2302 AsyncCall(env, req_wrap_async, args, "read", UTF8, AfterInteger,
2308 int bytesRead = SyncCall(env, /* ctx */ args[4], &req_wrap_sync, "read",
2311 args.GetReturnValue().Set(bytesRead);
2319 static void Chmod(const FunctionCallbackInfo<Value>& args) {
2320 Environment* env = Environment::GetCurrent(args);
2322 const int argc = args.Length();
2325 BufferValue path(env->isolate(), args[0]);
2328 CHECK(args[1]->IsInt32());
2329 int mode = args[1].As<Int32>()->Value();
2331 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
2335 AsyncCall(env, req_wrap_async, args, "chmod", UTF8, AfterNoArgs,
2341 SyncCall(env, args[3], &req_wrap_sync, "chmod",
2351 static void FChmod(const FunctionCallbackInfo<Value>& args) {
2352 Environment* env = Environment::GetCurrent(args);
2354 const int argc = args.Length();
2357 CHECK(args[0]->IsInt32());
2358 const int fd = args[0].As<Int32>()->Value();
2360 CHECK(args[1]->IsInt32());
2361 const int mode = args[1].As<Int32>()->Value();
2363 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
2366 AsyncCall(env, req_wrap_async, args, "fchmod", UTF8, AfterNoArgs,
2372 SyncCall(env, args[3], &req_wrap_sync, "fchmod",
2382 static void Chown(const FunctionCallbackInfo<Value>& args) {
2383 Environment* env = Environment::GetCurrent(args);
2385 const int argc = args.Length();
2388 BufferValue path(env->isolate(), args[0]);
2391 CHECK(IsSafeJsInt(args[1]));
2392 const uv_uid_t uid = static_cast<uv_uid_t>(args[1].As<Integer>()->Value());
2394 CHECK(IsSafeJsInt(args[2]));
2395 const uv_gid_t gid = static_cast<uv_gid_t>(args[2].As<Integer>()->Value());
2397 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2401 AsyncCall(env, req_wrap_async, args, "chown", UTF8, AfterNoArgs,
2407 SyncCall(env, args[4], &req_wrap_sync, "chown",
2417 static void FChown(const FunctionCallbackInfo<Value>& args) {
2418 Environment* env = Environment::GetCurrent(args);
2420 const int argc = args.Length();
2423 CHECK(args[0]->IsInt32());
2424 const int fd = args[0].As<Int32>()->Value();
2426 CHECK(IsSafeJsInt(args[1]));
2427 const uv_uid_t uid = static_cast<uv_uid_t>(args[1].As<Integer>()->Value());
2429 CHECK(IsSafeJsInt(args[2]));
2430 const uv_gid_t gid = static_cast<uv_gid_t>(args[2].As<Integer>()->Value());
2432 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2435 AsyncCall(env, req_wrap_async, args, "fchown", UTF8, AfterNoArgs,
2441 SyncCall(env, args[4], &req_wrap_sync, "fchown",
2448 static void LChown(const FunctionCallbackInfo<Value>& args) {
2449 Environment* env = Environment::GetCurrent(args);
2451 const int argc = args.Length();
2454 BufferValue path(env->isolate(), args[0]);
2457 CHECK(IsSafeJsInt(args[1]));
2458 const uv_uid_t uid = static_cast<uv_uid_t>(args[1].As<Integer>()->Value());
2460 CHECK(IsSafeJsInt(args[2]));
2461 const uv_gid_t gid = static_cast<uv_gid_t>(args[2].As<Integer>()->Value());
2463 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2467 AsyncCall(env, req_wrap_async, args, "lchown", UTF8, AfterNoArgs,
2473 SyncCall(env, args[4], &req_wrap_sync, "lchown",
2480 static void UTimes(const FunctionCallbackInfo<Value>& args) {
2481 Environment* env = Environment::GetCurrent(args);
2483 const int argc = args.Length();
2486 BufferValue path(env->isolate(), args[0]);
2489 CHECK(args[1]->IsNumber());
2490 const double atime = args[1].As<Number>()->Value();
2492 CHECK(args[2]->IsNumber());
2493 const double mtime = args[2].As<Number>()->Value();
2495 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2499 AsyncCall(env, req_wrap_async, args, "utime", UTF8, AfterNoArgs,
2505 SyncCall(env, args[4], &req_wrap_sync, "utime",
2511 static void FUTimes(const FunctionCallbackInfo<Value>& args) {
2512 Environment* env = Environment::GetCurrent(args);
2514 const int argc = args.Length();
2517 CHECK(args[0]->IsInt32());
2518 const int fd = args[0].As<Int32>()->Value();
2520 CHECK(args[1]->IsNumber());
2521 const double atime = args[1].As<Number>()->Value();
2523 CHECK(args[2]->IsNumber());
2524 const double mtime = args[2].As<Number>()->Value();
2526 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2529 AsyncCall(env, req_wrap_async, args, "futime", UTF8, AfterNoArgs,
2535 SyncCall(env, args[4], &req_wrap_sync, "futime",
2541 static void LUTimes(const FunctionCallbackInfo<Value>& args) {
2542 Environment* env = Environment::GetCurrent(args);
2544 const int argc = args.Length();
2547 BufferValue path(env->isolate(), args[0]);
2550 CHECK(args[1]->IsNumber());
2551 const double atime = args[1].As<Number>()->Value();
2553 CHECK(args[2]->IsNumber());
2554 const double mtime = args[2].As<Number>()->Value();
2556 FSReqBase* req_wrap_async = GetReqWrap(args, 3);
2560 AsyncCall(env, req_wrap_async, args, "lutime", UTF8, AfterNoArgs,
2566 SyncCall(env, args[4], &req_wrap_sync, "lutime",
2572 static void Mkdtemp(const FunctionCallbackInfo<Value>& args) {
2573 Environment* env = Environment::GetCurrent(args);
2576 const int argc = args.Length();
2579 BufferValue tmpl(isolate, args[0]);
2582 const enum encoding encoding = ParseEncoding(isolate, args[1], UTF8);
2584 FSReqBase* req_wrap_async = GetReqWrap(args, 2);
2588 AsyncCall(env, req_wrap_async, args, "mkdtemp", encoding, AfterStringPath,
2594 SyncCall(env, args[3], &req_wrap_sync, "mkdtemp",
2603 Local<Object> ctx = args[3].As<Object>();
2607 args.GetReturnValue().Set(rc.ToLocalChecked());