Yes, we recommend it. Downloading becomes faster and simpler from the Yahoo! Widget Gallery Widget. With the UNIX Utility calls in your Widget replaced with native Yahoo! Widgets calls, the download process doesn't have to navigate to a browser window in case the user doesn't have UNIX Utilities.
There are a number of replacements to UNIX utilities available in the API. The tables below list them. If your Widget is currently using any of these UNIX utilities, then either use the native Yahoo! Widgets replacement or bundle the required UNIX utilities with your Widget.
| UNIX Utility | Yahoo! Widgets native call | |
|---|---|---|
| cat | filesystem.readFile( ); | |
| cp | filesystem.copy( ); | |
| curl | URL or XMLHttpRequest objects | |
| date | Date object (see the Mozilla Core JavaScript documentation) | |
| find | filesystem.getDirectoryContents( ); | |
| ls | filesystem.getDirectoryContents( ); | |
| mv | filesystem.move( ); (Note - Cannot yet be used to rename files) | |
| open | filesystem.open( ); | |
| sleep | sleep( ); |
If you throw in a system.platform check to make sure you're on Windows, you can use a couple of Windows shell commands in place of the UNIX utilities:
| UNIX Utility | Windows Shell Command | |
|---|---|---|
| rm | rmdir for folders, erase for files | |
| mkdir | ...mkdir |
Have a look at version 4.0 of the Yahoo! Widgets Reference Manual for more information on these different items.
Of course, if you've got a Widget already in the Gallery that uses the UNIX utilities, it's not going to break. We are committed to making sure that, within reason, all of our upgrades are backwards compatible and the existing features and functionality for these Widgets will continue as before. Nevertheless, we strongly encourage you to update these older Widgets to take advantage of the benefits of replacing UNIX Utility calls with the new native Yahoo! Widgets calls.