Skip to content

Commit

Permalink
Fixed directory scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
evshvarov committed Jan 22, 2017
1 parent bd96d22 commit 4f8d9ea
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions sc.alles.cls
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ ClassMethod import(filemask = "*.*", qspec = "cku-d", ByRef err = "", recurse =

s sc = 1, dirs = "", dir = ..workdir() $$$push(dir)

s rs = ##class(%ResultSet).%New( "%Library.File:FileSet" )
for { $$$next(i,dir) Q:i="" Q:dir=""

s sc = rs.Execute( dir, filemask ) Q:'sc

while rs.Next() {
s rs = ##class(%File).FileSetFunc( dir, filemask, , 1 )

while rs.%Next() {
s filename = rs.Name

if $$$isDirectory(rs.Type) {
Expand All @@ -103,7 +101,6 @@ ClassMethod import(filemask = "*.*", qspec = "cku-d", ByRef err = "", recurse =

Q sc
}

/// get or set working directory for export/import source
ClassMethod workdir(workdir)
{
Expand Down Expand Up @@ -171,14 +168,11 @@ ClassMethod importUpdated(filemask = "*.*", qspec = "cku-d", ByRef err = "", rec
#define log w !, filename, " -> ", codename, " ", +sc

s sc = 1, dirs = "", dir = ..workdir() $$$push(dir)

s rs = ##class(%ResultSet).%New( "%Library.File:FileSet" )
for { $$$next(i,dir) Q:i="" Q:dir=""

s sc = rs.Execute( dir, filemask ) Q:'sc

while rs.Next() {
s rs = ##class(%File).FileSetFunc( dir, filemask, , 1 )

while rs.%Next() {
s filename = rs.Name

if $$$isDirectory( rs.Type ) {
Expand Down

0 comments on commit 4f8d9ea

Please sign in to comment.