rob_cole_2221866's profile

4.5K Messages

 • 

76.3K Points

Wed, Oct 26, 2011 1:54 PM

Closed

Lightroom SDK: LrFileUtils.moveToTrash is returning bogus values.

LrFileUtils.moveToTrash says it didn't move file to trash but it did.

(Its returning false with no accompanying reason, yet file has been successfully moved to recycle-bin).

Lightroom version: 3.5 [775451]
Operating system: Windows 7 Ultimate Edition
Version: 6.1 [7601]
Application architecture: x64
System architecture: x64
Physical processor count: 4
Processor speed: 3.4 GHz
Built-in memory: 7934.1 MB
Real memory available to Lightroom: 7934.1 MB
Real memory used by Lightroom: 1751.8 MB (22.0%)
Virtual memory used by Lightroom: 2104.5 MB
Memory cache size: 1258.0 MB
System DPI setting: 96 DPI
Desktop composition enabled: Yes
Displays: 1) 1920x1200, 2) 1920x1200

Its happening all the time now, but I swear it has worked before (not sure which version), although it seems like I had some doubts about it once before too - memory fuzzy...

Champion

 • 

6K Messages

 • 

103.7K Points

10 y ago

I just tested Any File's Delete command, which uses LrFileUtils.moveToTrash(). In that context on my machine (LR 3.5, Windows 7 64-bit) it is operating correctly. So perhaps something more specific to your configuration?

4.5K Messages

 • 

76.3K Points

Thanks for checking John.

Champion

 • 

704 Messages

 • 

8.5K Points

10 y ago

How many items already in your trash? Are you trying to move a file to a trash on a removable drive, or some other non-local volume?

Do you have journalling enabled on the volume (assuming Win7 NTFS supports some notion of journalling.)

4.5K Messages

 • 

76.3K Points

17,955
No
No
No

i.e. lots, and reglar local, but non-system drive.

My present workaround is to ignore status and test for file's existence after moving, which does seem to work reliably.

Champion

 • 

6K Messages

 • 

103.7K Points

Does the problem still occur when the Recycle Bin is empty? There was the performance problem mentioned in LR 3.2(?) release notes triggered by a "ful" recycle bin. Hard to see how that would cause this issue, but you know bugs...

4.5K Messages

 • 

76.3K Points

Stupid mistake - I was calling it twice for the same file. Sorry for the false alarm...

Note: contrary to the documentation, if file not found, move-to-trash returns false with no reason.

PS - move-to-trash always fails if file is on network-share - something to watch out for...

4.5K Messages

 • 

76.3K Points

10 y ago

Bottom line:
----------------
The original problem report was due to operator error, *but* the documentation should be augmented to stipulate what happens when file not found, or file on network share....

Bonus Idea:
---------------
Consider a second parameter: "OK to just delete if file on network share...".
i.e. move-to-trash (or bust) vs. move-to-trash (if possible).

Champion

 • 

6K Messages

 • 

103.7K Points

10 y ago

I just tried Any File with a file on a network share, and moveToTrash() returned false, with the error message "cantFindTrash".

I agree that the documentation should be improved, since it never occurred to me either that this would fail with a file on a network share.

I also agree that it would be more convenient to have a second parameter, "alwaysDelete".