fileObj.length on .psb files return 0 or -1

Discussion of actual or possible Photoshop Scripting Bugs, Anomalies and Documentation Errors

Moderators: Tom, Kukurykus

dpaintArexx
Posts: 8
Joined: Tue Nov 14, 2023 12:11 pm

fileObj.length on .psb files return 0 or -1

Post by dpaintArexx »

Hi,

When trying to access the length property of a File object, large .psb files return 0 or -1 instead of the byte value.

This dispite of the file being closed, as documented in the Javascript Tools Guide.

Code: Select all

// LARGE PSB FILE 1GB+
var fileObj = new File("../path/myFile.psb");
fileObj.close() // return true
fileObj.exists // return true
fileObj.length // return 0 or -1

// SMALLER, NORMAL PSD FILE
var fileObj = new File("../path/myFile.psd");
fileObj.close() // return true
fileObj.exists // return true
fileObj.length // return 3604010
Any clues?

I probably can make a workaround with a system call, though.