Skip to content

Commit

Permalink
excluding read-only folders on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Aug 23, 2023
1 parent db2cc6d commit e4cef3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions folder/folderutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

fileutil "github.com/projectdiscovery/utils/file"
osutils "github.com/projectdiscovery/utils/os"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -127,6 +128,12 @@ func TestIsWritable(t *testing.T) {
})

t.Run("Test non-writable directory", func(t *testing.T) {
// on windows bitsets are applied only to files
// https://github.com/golang/go/issues/35042
if osutils.IsWindows() {
return
}

nonWritableDir := "non-writable-dir"
err := os.Mkdir(nonWritableDir, 0400)
assert.NoError(t, err)
Expand Down

0 comments on commit e4cef3e

Please sign in to comment.