解决了使用Javascript访问最新Windows 10版本中的文件/文件夹的长路径(> 260 char)限制 [英] Resolving long path (>260 char) limitation for accessing files/folders in latest Windows 10 build using Javascript

查看:165
本文介绍了解决了使用Javascript访问最新Windows 10版本中的文件/文件夹的长路径(> 260 char)限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建Cordova Windows应用程序,由于Windows的限制,在我的应用程序访问路径长度大于260个字符的文件和文件夹时遇到错误.为了访问或创建新文件和文件夹,当前,我正在使用Windows(运行时)API的Java的Windows.Storage命名空间,并使用诸如createFolderAsync,getFolderAsync,getFileFromPathAsync等功能.

I am building a cordova windows application and get an error in accessing files and folders from my application that have path lengths greater than 260 characters because of the windows limitation. For accessing or creating new files and folders, currently, I am using Windows.Storage namespace of Windows (Runtime) API for Javascript with functions such as createFolderAsync, getFolderAsync, getFileFromPathAsync etc.

最近,我听说Windows 10的最新版本已删除文件/文件夹路径的260个字符限制. (以下是

Recently, I heard that the latest build of Windows 10 has removed the 260 character limit for paths of files/folders. (Here is the link) But this is only available in some particular Win32 functions available in C++, and to call them in my app, I need to make a Windows Runtime component in C++. (1) Is there a way, I can leverage the latest changes in the latest Windows 10 build (version 1607) to directly create/access files and folders with path lengths > 260 chars? (2) Is this limitation still there in the javascript Windows libraries and do we really have no option but to involve win32 C++ APIs to do away with this problem? (3) Is windows considering to remove this limitation from all other libraries as well in the future?

提前谢谢!

推荐答案

启动gpedit.msc(Windows + R)

Launch gpedit.msc (Windows + R)

转到本地计算机策略"->计算机配置"->管理模板"->系统"->文件系统"

Go to "Local Computer Policy" -> "Computer Configuration" -> "Administrative Templates" -> "System" -> "Filesystem"

打开启用Win32长路径",然后选择启用"

Open "Enable Win32 long paths" and select Enabled

这篇关于解决了使用Javascript访问最新Windows 10版本中的文件/文件夹的长路径(> 260 char)限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆