Skip to content
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

Add fix to handle max path limit in windows #130

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/transformer/src/IModelTransformer.ts
Original file line number Diff line number Diff line change
@@ -2151,7 +2151,9 @@ export class IModelTransformer extends IModelExportHandler {
let schemaFileName = schema.name + ext;
// many file systems have a max file-name/path-segment size of 255, so we workaround that on all systems
const systemMaxPathSegmentSize = 255;
if (schemaFileName.length > systemMaxPathSegmentSize) {
// windows usually has a limit for the total path length of 260
const windowsMaxPathLimit = 260;
if (schemaFileName.length > systemMaxPathSegmentSize || path.join(this._schemaExportDir, schemaFileName).length >= windowsMaxPathLimit) {
// this name should be well under 255 bytes
// ( 100 + (Number.MAX_SAFE_INTEGER.toString().length = 16) + (ext.length = 13) ) = 129 which is less than 255
// You'd have to be past 2**53-1 (Number.MAX_SAFE_INTEGER) long named schemas in order to hit decimal formatting,