LongPath | drop-in library to support long paths in .NET | DevOps library
kandi X-RAY | LongPath Summary
kandi X-RAY | LongPath Summary
[nuget badge] a drop-in library to support long paths in .net. supporting files and directories with a long path is fairly easy with windows. unfortunately, other aspects of windows haven’t supported long paths in their entirely. the file system (ntfs), for example, supports long paths quite well; but other things like command prompt and explorer don’t. this makes it hard to entirely support long paths in any application, let alone in .net. this has been a bit tricky in .net. several attempts like [longpaths.codeplex.com] (which a more up to date version has made its way into .net in classes like [longpath] [longpathfile] and [longpathdirectory] but, these libraries do not seem to support the entire original api (path, file, directory) and not all file-related apss (including fileinfo, directoryinfo, filesysteminfo). often times long path support is an after thought. usually after you’ve released something and someone logs bug (e.g. "when i use a path like c:\\users\*300 chars removed*\\document.docx your software gives me an error". you can likely support long paths with the above-mentioned libraries, but you end up having to scrub your code and re-design it to suit these
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of LongPath
LongPath Key Features
LongPath Examples and Code Snippets
Community Discussions
Trending Discussions on LongPath
QUESTION
In a C++ console application on windows, i'm trying to break the MAX_PATH restriction for the SetCurrentDirectoryW function.
There are many similar questions already asked but none got a usable answer:
- How to enable "Long Path Aware" behavior via manifest in a C++ executable?
- Are long path behavior per app can be enable via the manifest?
Apparently this might be possible by using application manifest files. The docs for SetCurrentDirectoryW state:
Tip Starting with Windows 10, version 1607, for the unicode version of this function (SetCurrentDirectoryW), you can opt-in to remove the MAX_PATH limitation. See the "Maximum Path Length Limitation" section of Naming Files, Paths, and Namespaces for details.
And from the general docs about Manifests:
Manifests are XML files that accompany and describe side-by-side assemblies or isolated applications. ... Application Manifests describe isolated applications. They are used to manage the names and versions of shared side-by-side assemblies that the application should bind to at run time. Application manifests are copied into the same folder as the application executable file or included as a resource in the application's executable file.
The docs about Assembly Manifests point out the difference to Application Manifests once more:
As a resource in a DLL, the assembly is available for the private use of the DLL. An assembly manifest cannot be included as a resource in an EXE. An EXE file may include an Application Manifests as a resource.
The docs about Application Manifests list the assembly and assemblyIdentity elements as required:
The assembly element requires exactly one attribute:
- manifestVersion
- The manifestVersion attribute must be set to 1.0.
- manifestVersion
The assemblyIdentity element requires the following attributes:
- type
- The value must be Win32 and all in lower case
- name
- Use the following format for the name: Organization.Division.Name. For example Microsoft.Windows.mysampleApp.
- version
- Specifies the application or assembly version. Use the four-part version format: mmmmm.nnnnn.ooooo.ppppp. Each of the parts separated by periods can be 0-65535 inclusive. For more information, see Assembly Versions.
- type
All other elements and attributes seem to be optional.
Additional requirements for the assembly element are:
Its first subelement must be a noInherit or assemblyIdentity element. The assembly element must be in the namespace "urn:schemas-microsoft-com:asm.v1". Child elements of the assembly must also be in this namespace, by inheritance or by tagging.
Finally, there's the longPathAware element which is optional but which should hopefully allow SetCurrentDirectoryW to use long paths:
Enables long paths that exceed MAX_PATH in length. This element is supported in Windows 10, version 1607, and later. For more information, see this article.
The section in the docs shows this example xml manifest:
...ANSWER
Answered 2022-Mar-24 at 13:16The manifest applies to your application, it allows you to opt in to long path support.
However, long path support must also be enabled system wide. This is the group policy "Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths".
QUESTION
- git version 2.32.0.windows.1
- TortoiseGit 2.13.0.1
- git config -l
- Diff Tool: BeyondCompare
ANSWER
Answered 2022-Mar-18 at 14:37As @torek stated out in the comments: the .gitattribute text settings caused the problem. We committed those modified files and everything went well after that.
QUESTION
I need to install a dependency from git like this:
npm i git://hostname.com/scm/projects/project.name.git#tag123
unfortunatly it fails with:
...ANSWER
Answered 2022-Jan-19 at 15:49Solution
Delete the git installation folder (e.g.: C:\Program Files\Git
) completely and install the latest git version from https://git-scm.com/downloads.
Seems like a git interanl config get corrupt.
QUESTION
I have below code in place, which uses below ES6 syntax in a TS file settings.ts,
...ANSWER
Answered 2021-Nov-18 at 20:40Finally, after a research found the solution.
Project Typescript Build properties my project was referring to 2.5 as I mentioned above. In MicrosoftDKs location I had higher version.
Open Visual Studio Installer> modify 2017 > Unselect Typescript version 2.5 Click Save changes
Now this version is removed and msbuild defaulted to highest available without making Project reference changes.
Another alternative if you want you can upgrade from TypescriptBuild properties to "Use Latest Version" option instead of specifying any version. Make sure you are aware of any compatibility issues.
QUESTION
I must probably have unknowingly mispunched some keys and triggered a strange change in the state of my local git repository, for now git is refusing to track some files. That is :
If I do git add -f myfile.txt
, it executes and returns silently but after that git ls-files -v myfile.txt
still returns nothing when it should return myfile.txt
, and git status
still says nothing to commit
.
Someone suggested that problem might have to do with some filenames being too long, so I tried git config core.longpaths true
followed by git add .
and git add -A
.
And yes, I did check that the file exists and the path is correct : file myfile.txt
tells me it's an ASCII text.
What other git commands may I use to get a better understanding of the situation ?
UPDATE : In the output of git ls-tree -r HEAD
, my file is listed , albeit with a slight modification : what I called myfile.txt
above for short is really a long file path with several directories. The corresponding entry in git ls-tree -r HEAD
is an identical path except that the first directory is uncapitalized (I and the Unix system call it Depth_one
but git calls it depth_one
).
ANSWER
Answered 2021-Sep-15 at 00:04TL;DR summary: the root issue here is case-folding. You may wish to convince Git to rename all the files. (Files in Git's index, AKA staging area, are not in folders, they just have long names that seem to have folder-names embedded within them. The names you need to change are therefore all the ones that start with the lowercase "folder" string.) Alternatively, make your working tree match the Git commits: in Git, file names are case sensitive.
Long, with reproducible exampleUPDATE : In the output of
git ls-tree -r HEAD
, my file is listed , albeit with a slight modification : what I calledmyfile.txt
above for short is really a long file path with several directories. The corresponding entry ingit ls-tree -r HEAD
is an identical path except that the first directory is uncapitalized (I and the Unix system call itDepth_one
but git calls itdepth_one
).
This, and the fact that you are on macOS—or at a lower level, using a case-insensitive file system—are the key items. I was able to reproduce your issue on my own Mac, although perhaps with a slightly different reproducer. (This sort of thing is why a Minimal Reproducible Example is so important here. Simplifying a problem to its nub is good, but simplifying it to the point where it's gone is no help at all!)
To reproduce the problem, I ran:
QUESTION
I am new to PostgreSQL and in recursive queries and have this following problem: I have the following tables
- node(id, colour)
- edge(n1,n2)
I have to write a query with a recursive statement that returns the shortest and longest paths between each pair of nodes. The output should look like this: (id1,id2, shortpath,longpath)
...ANSWER
Answered 2021-Jun-18 at 18:30SQL is probably not the best tool to do this, but you can do it using a recursive CTE.
For example:
QUESTION
I'm trying to clone a project from git by this:
...ANSWER
Answered 2021-May-05 at 09:11This is a simple one. Check the documentation to the installation types based on your OS. For linux, just follow these commands:
Download and install the Git command line extension. Once downloaded and installed, set up Git LFS for your user account by running:
QUESTION
Hey guys I have been trying to connect my R to to the project on gitlab for a couple of days but I keep running into error. I researched it online and tried every step suggested but it still did not work for me. When I use the https link and open a new project in R, enter my credentials and clone the git repository, I get the following error
error: invalid path ' Monthly internal audit code ' fatal: unable to checkout working tree warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/'
I read online that I need to use 'git config --system core.longpaths true' to read files with long names but it did not work either. I have previously been able to clone the project with no errors so I don't think there is an issue with the file name. I have tried many other solutions as well but nothing is working. I would really appreciate it if someone can help me isolate the problem and fix it.
...ANSWER
Answered 2021-Apr-02 at 14:24error: invalid path ' Monthly internal audit code '
The filename has a leading and a trailing spaces and it seems you're on a graphical environment that doesn't allow such filenames.
The only way to fix it is to clone the repository on a Unix/Linux OS (try WSL2, docker, a virtual machine), fix the filename and commit.
QUESTION
For Each File In Folder.Files
works fine as long as the lengths of the file names (incl. Path) are within the limit of Windows, which is 259 characters. But if a file name (incl. Path) is longer, then it doesn't work.
Here's an example:
...ANSWER
Answered 2021-Jan-03 at 04:47See Hans' answer in this QA: Access files with long paths (over 260)
Basically, change your paths to use \\?\
as a prefix:
Btw, I modified your code as follows:
- Using
Option Explicit
- Removing the
Call
keyword from function invocation statements, note that parentheses must be omitted when not usingCall
. - Using
camelCase
for locals.
QUESTION
Our Laravel project is using symlinks. Recently when I tried to pull from my colleague's work, I get this message:
...ANSWER
Answered 2020-Nov-16 at 04:06Running git pull
is just running two Git commands:
- First,
git pull
runsgit fetch
. This obtains any new commits needed for the second command. - Second,
git pull
runs ... well, this can be complicated. You are having it run the default, though:git merge
.
Usually when git pull
fails, one of these two commands that it runs is the one that actually failed. The second command fails more often unless you have a particularly flaky Internet connection. In your case, it's the git merge
that failed.
The word failed is usually too strong, really. Most merges do not actually fail. They just stop in the middle of the operation due to a conflict (or two conflicts, in your particular case). But your merge is a little special. It really does have an internal failure, which repeats several times:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install LongPath
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page