-
Notifications
You must be signed in to change notification settings - Fork 89
Add anymaputils #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add anymaputils #740
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| .anymap.writeToAnyMap:{[data;filePath] (hsym filePath) 1: data; :(::)} | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. most data writing functions in q have filepath as first param & data as second (e.g. |
||||||
| .anymap.deriveAnymapFiles:{[filePath] strPath: string[filePath]; `$(strPath;strPath,"#";strPath,"##")} | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
think something like this should work the same |
||||||
| .anymap.util.copyAnyMap:{[fromFilePath; destFilePath] fromFilePaths:.anymap.deriveAnymapFiles[fromFilePath]; system (("cp "," " sv string fromFilePaths), " ", string destFilePath)} | ||||||
| .anymap.util.removeAnyMap:{[filePath] filePaths:.anymap.deriveAnymapFiles[filePath]; system ("rm "," " sv string filePaths)} | ||||||
| .anymap.util.moveAnyMap:{[fromFilePath; destFilePath] fromFilePaths:.anymap.deriveAnymapFiles[fromFilePath]; system (("mv "," " sv string fromFilePaths), " ", string destFilePath)} | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these copy/remove/move functions rely on system commands and will only work on Linux. Should use the functions in |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lots of camelCase here, please remove