Skip to content

Commit d62bda8

Browse files
committed
file.hdb: Add new par.txt wrapper function
1 parent feadb0e commit d62bda8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/file.hdb.q

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// File Manipulation for HDBs
2+
// Copyright (c) 2021 Jaskirat Rajasansir
3+
4+
5+
/ Wrapper for '.Q.par' to deal with relative paths for a segmented DB configuration in the 'par.txt' file
6+
/ @param hdbRoot (FolderPath) The HDB root to run against
7+
/ @param partVal (Date|Month|Year|Long) The specific partition to lookup with 'par.txt' if present
8+
/ @returns (FolderPath) The expected location of the partition within the HDB
9+
.file.hdb.qPar:{[hdbRoot; partVal]
10+
par:.Q.par[hdbRoot; partVal; `];
11+
strPar:1_ string par;
12+
13+
if[not "/" = first strPar;
14+
strPar:string[hdbRoot],"/",strPar;
15+
];
16+
17+
:hsym `$strPar;
18+
};

0 commit comments

Comments
 (0)