LongPath | drop-in library to support long paths in .NET | DevOps library

 by   peteraritchie C# Version: Current License: LGPL-3.0

kandi X-RAY | LongPath Summary

kandi X-RAY | LongPath Summary

LongPath is a C# library typically used in Devops applications. LongPath has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

[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

            kandi-support Support

              LongPath has a low active ecosystem.
              It has 109 star(s) with 39 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 23 open issues and 45 have been closed. On average issues are closed in 265 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of LongPath is current.

            kandi-Quality Quality

              LongPath has 0 bugs and 0 code smells.

            kandi-Security Security

              LongPath has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              LongPath code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              LongPath is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              LongPath releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              LongPath saves you 207006 person hours of effort in developing the same functionality from scratch.
              It has 206772 lines of code, 0 functions and 40 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of LongPath
            Get all kandi verified functions for this library.

            LongPath Key Features

            No Key Features are available at this moment for LongPath.

            LongPath Examples and Code Snippets

            No Code Snippets are available at this moment for LongPath.

            Community Discussions

            QUESTION

            How to enable "Long Path Aware" behavior for setting the current directory in a C++ windows console app
            Asked 2022-Mar-24 at 16:30

            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:

            Doc Research

            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.
            • 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.

            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:16

            The 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".

            Source https://stackoverflow.com/questions/71602123

            QUESTION

            Git shows unmodified files as modified
            Asked 2022-Mar-18 at 14:37
            Setup
            • 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:37

            As @torek stated out in the comments: the .gitattribute text settings caused the problem. We committed those modified files and everything went well after that.

            Source https://stackoverflow.com/questions/71494869

            QUESTION

            npm / git fails with: refusing to work with credential missing host field
            Asked 2022-Jan-19 at 15:49

            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:49

            Solution

            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.

            Source https://stackoverflow.com/questions/69538431

            QUESTION

            Visual Studio 2017 MSBUILD giving TS1005 error on typescript ES6 syntax
            Asked 2021-Nov-18 at 20:40

            I have below code in place, which uses below ES6 syntax in a TS file settings.ts,

            ...

            ANSWER

            Answered 2021-Nov-18 at 20:40

            Finally, 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.

            Source https://stackoverflow.com/questions/70025237

            QUESTION

            Git refuses to track some files (git add -f not working)
            Asked 2021-Sep-15 at 00:04

            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:04

            TL;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 example

            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).

            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:

            Source https://stackoverflow.com/questions/69179540

            QUESTION

            Find shortest and longest path with recursive postgreSql
            Asked 2021-Jun-18 at 18:30

            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:30

            SQL is probably not the best tool to do this, but you can do it using a recursive CTE.

            For example:

            Source https://stackoverflow.com/questions/68037501

            QUESTION

            Git clone git-lfs filter-process: git-lfs: command not found
            Asked 2021-May-05 at 09:11

            I'm trying to clone a project from git by this:

            ...

            ANSWER

            Answered 2021-May-05 at 09:11

            This is a simple one. Check the documentation to the installation types based on your OS. For linux, just follow these commands:

            1. Download and install the Git command line extension. Once downloaded and installed, set up Git LFS for your user account by running:

            Source https://stackoverflow.com/questions/67395259

            QUESTION

            cloning a git project
            Asked 2021-Apr-02 at 14:24

            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:24

            error: 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.

            Source https://stackoverflow.com/questions/66920454

            QUESTION

            'For Each File In Folder.Files' does not list all files
            Asked 2021-Jan-04 at 12:15

            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:47
            Approach 1: Use NT Object Path-style paths:

            See 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 using Call.
            • Using camelCase for locals.

            Source https://stackoverflow.com/questions/65545904

            QUESTION

            Cannot git pull due CONFLICT(MODIFY/DELETE) and symlink
            Asked 2020-Nov-16 at 04:06

            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:06

            Running git pull is just running two Git commands:

            • First, git pull runs git 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:

            Source https://stackoverflow.com/questions/64851754

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install LongPath

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/peteraritchie/LongPath.git

          • CLI

            gh repo clone peteraritchie/LongPath

          • sshUrl

            git@github.com:peteraritchie/LongPath.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular DevOps Libraries

            ansible

            by ansible

            devops-exercises

            by bregman-arie

            core

            by dotnet

            semantic-release

            by semantic-release

            Carthage

            by Carthage

            Try Top Libraries by peteraritchie

            ProductivityExtensions

            by peteraritchieC#

            Messaging.Patterns

            by peteraritchieC#

            AdvancedUnitTesting

            by peteraritchieC#

            EffectiveIoC

            by peteraritchieC#