@sasjs/core 4.40.0 → 4.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/mp_hashdirectory.sas +15 -2
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
%put %sysfunc(hashing_file(md5,/path/to/file.blob,0));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Actual usage:
|
|
13
13
|
|
|
14
14
|
%let fpath=/some/directory;
|
|
15
15
|
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
the folder hashes cascade upwards so you know immediately if there is a
|
|
32
32
|
change in a sub/sub directory
|
|
33
33
|
@li If the folder has no content (empty) then it is ignored. No hash created.
|
|
34
|
+
@li If the file is empty, it is also ignored / no hash created.
|
|
34
35
|
|
|
35
36
|
<h4> SAS Macros </h4>
|
|
36
37
|
@li mp_dirlist.sas
|
|
@@ -86,7 +87,19 @@ data &outds;
|
|
|
86
87
|
|
|
87
88
|
ts=datetime();
|
|
88
89
|
if file_or_folder='file' then do;
|
|
89
|
-
|
|
90
|
+
/* if file is empty, hashing_file will break - so ignore / delete */
|
|
91
|
+
length fname val $8;
|
|
92
|
+
drop fname val fid is_empty;
|
|
93
|
+
rc=filename(fname,file_path);
|
|
94
|
+
fid=fopen(fname);
|
|
95
|
+
if fid > 0 then do;
|
|
96
|
+
rc=fread(fid);
|
|
97
|
+
is_empty=fget(fid,val);
|
|
98
|
+
end;
|
|
99
|
+
rc=fclose(fid);
|
|
100
|
+
rc=filename(fname);
|
|
101
|
+
if is_empty ne 0 then delete;
|
|
102
|
+
else file_hash=hashing_file("&method",cats(file_path),0);
|
|
90
103
|
end;
|
|
91
104
|
hash_duration=datetime()-ts;
|
|
92
105
|
run;
|
package/package.json
CHANGED