Community
    • Login

    Write access forbidden

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    12 Posts 3 Posters 1.7k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rinku singhR Offline
      rinku singh
      last edited by

      at this time are you seeking a plugin or script who notify if file has already opened in npp or another editor ?

      1 Reply Last reply Reply Quote 0
      • Tobias DietrichT Offline
        Tobias Dietrich
        last edited by

        Yes an plugin or if there is any setting to change this.

        1 Reply Last reply Reply Quote 0
        • rinku singhR Offline
          rinku singh
          last edited by

          document list panel can show you file has set as read only

          setting > preference > general > document list panel

          1 Reply Last reply Reply Quote 0
          • Tobias DietrichT Offline
            Tobias Dietrich
            last edited by

            With document list panel I can´t see that the file is already opened by an other user.

            1 Reply Last reply Reply Quote 0
            • rinku singhR Offline
              rinku singh
              last edited by

              yes i have c# code for write a plugin for notify if file in use (file is busy) but not sure it works file who in use by other user

              protected virtual bool IsFileLocked(FileInfo file)
              {
                  FileStream stream = null;
              
                  try
                  {
                      stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None);
                  }
                  catch (IOException)
                  {
                      //the file is unavailable because it is:
                      //still being written to
                      //or being processed by another thread
                      //or does not exist (has already been processed)
                      return true;
                  }
                  finally
                  {
                      if (stream != null)
                          stream.Close();
                  }
              
                  //file is not locked
                  return false;
              }
              
              1 Reply Last reply Reply Quote 0
              • Tobias DietrichT Offline
                Tobias Dietrich
                last edited by

                I don´t know, how I import this code as plugin.

                1 Reply Last reply Reply Quote 0
                • rinku singhR Offline
                  rinku singh
                  last edited by

                  file is just not busy by npp

                  1 Reply Last reply Reply Quote 0
                  • Tobias DietrichT Offline
                    Tobias Dietrich
                    last edited by

                    I don´t know what I should do with this c# code.

                    1 Reply Last reply Reply Quote 0
                    • pnedevP Offline
                      pnedev
                      last edited by

                      @Tobias-Dietrich ,

                      Currently you cannot know that another person has already opened the file.
                      It is because the file is kept open for a very short time (only when reading it or writing it) and then it is immediately closed.

                      BR

                      1 Reply Last reply Reply Quote 2
                      • Tobias DietrichT Offline
                        Tobias Dietrich
                        last edited by

                        Ok many thanks for your answer. I know that other editors can lock this file during it is in use.
                        Is that option planned for development?

                        1 Reply Last reply Reply Quote 0
                        • pnedevP Offline
                          pnedev
                          last edited by pnedev

                          I don’t know but I don’t think so.
                          You can file a feature request here if you like:
                          https://github.com/notepad-plus-plus/notepad-plus-plus/issues

                          BR

                          1 Reply Last reply Reply Quote 0

                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                          With your input, this post could be even better 💗

                          Register Login
                          • First post
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors