-
Notifications
You must be signed in to change notification settings - Fork 93
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
Allow Save As and breadcrumb navigation #2060
Merged
Merged
Changes from 10 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f477cb5
Convert locale files to JSON instead of TS
worksofliam b94ce7c
Re-ordered and formatted
sebjulliand d0546d1
Added attr date parsing + test
sebjulliand dd74c33
Added createStreamFile method to content
sebjulliand ba62810
FS stat methods now returns actual information
sebjulliand 08dcb09
Working "Save as" on IFS files
sebjulliand 19f1c6f
Merge branch 'master' into feature/saveAs
sebjulliand 23912a0
Allow library path
sebjulliand 4166f7c
Completed save as/breadcrumbs support implementation
sebjulliand 43f91ac
Always throw FileSystemError from FileSystemProviders
sebjulliand 4885c89
Fixed Save As for members with no extension
sebjulliand a2075a6
Fixed parserMemberPath
sebjulliand 771fb9b
Removed filestatcache
sebjulliand b92321c
Merge branch 'master' into feature/saveAs
sebjulliand a3d99ab
Merge branch 'master' into feature/saveAs
sebjulliand b8d52e9
Handle save as for protected streamfiles/members
sebjulliand b439be5
Delete removed commands calls
sebjulliand ba07e47
Removed superfluous /
sebjulliand b6d9501
Fixed "getAttributes" to support variant characters
sebjulliand f8b0261
Merge branch 'master' into feature/saveAs
sebjulliand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import vscode from "vscode"; | ||
|
||
export class FileStatCache { | ||
private readonly cache: Map<string, vscode.FileStat | null> = new Map | ||
|
||
set(uri: vscode.Uri | string, stat: vscode.FileStat | null) { | ||
this.cache.set(toPath(uri), stat); | ||
} | ||
|
||
get(uri: vscode.Uri | string) { | ||
return this.cache.get(toPath(uri)); | ||
} | ||
|
||
clear(uri?: vscode.Uri | string) { | ||
if (uri) { | ||
this.cache.delete(toPath(uri)); | ||
} | ||
else { | ||
this.cache.clear(); | ||
} | ||
} | ||
} | ||
|
||
function toPath(uri: vscode.Uri | string) { | ||
return typeof uri === "string" ? uri : uri.path; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@sebjulliand This code is worrying me a bit - you get the attributes using the PASE command
attr
, which can return IBM i object attributes, but it writes the dates in text, which you then have to parse.The timestamps output from
attr
are dependent on the locale, which may vary from system to system - or even user by user.Wouldn't it be better to get the attributes for an IFS object using the SQL function
IFS_OBJECT_STATISTICS
? It can return the same information and returns the timestamps in ISO format - or as EPOCH, if it is specified in the SQL statement. Like we do with member lists...Then this parse function is irrelevant - and the month name at the top etc.
?
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.
Well, I tried (hard) to use
IFS_OBJECT_STATISTICS
, but it doesn't give any information if you don't have enough authority to do so. Every column will be null in this case. For example, there are some files on PUB400 that I can access in read-only mode. For those,IFS_OBJECT_STATISTICS
will not give me any information.I tried on a few different LPARS and even when I change
LC_TIME
before callingattr
, it still returns the dates using the en_US locale.So for now, I'll take the risk of using
attr
and parse the dates empirically. 😅