+int VFS_Reopen(int FD, const char *Path, int Flags)
+{
+ tVFS_Handle *h = VFS_GetHandle(FD);
+ if(!h) {
+ errno = EBADF;
+ return -1;
+ }
+
+ int newf = VFS_Open(Path, Flags);
+ if( newf == -1 ) {
+ return -1;
+ }
+
+ _CloseNode(h->Node);
+ _DereferenceMount(h->Mount, "Reopen");
+ memcpy(h, VFS_GetHandle(newf), sizeof(*h));
+ _ReferenceNode(h->Node);
+ _ReferenceMount(h->Mount, "Reopen");
+
+ VFS_Close(newf);
+
+ return FD;
+}
+