As a Uniface developer, you might encounter situations where you need to rename directories programmatically while bypassing file redirections. This is where the ldirrename statement comes in handy! 🚀
Note: This article is based on the Uniface documentation 10.4, and I had assistance from AI in creating this content.
🔧 What is ldirrename?
The ldirrename statement is a powerful Uniface function that renames directories while ignoring any file redirections defined in the assignment file. Think of it as a "direct" rename operation that bypasses the usual redirection logic.
📝 Syntax & Usage
The syntax is straightforward:
ldirrename DirPath, NewDirName
Example:
ldirrename "data/exports", "saved"
📊 Parameters Breakdown
| Parameter | Data Type | Description |
|---|---|---|
DirPath |
String | Directory name with optional path. Can be in a zip archive! 📦 |
NewDirName |
String | New directory name (no path, no trailing separator). Can also be in zip archives! |
⚡ Return Values & Error Handling
The function returns values via $procerror:
- 0 - Success! ✅
- -13 (
UIOSERR_OS_COMMAND) - OS command error ❌
Pro tip: Set /pri=64 to display detailed error messages in the message frame when troubleshooting! 🔍
🎯 Key Features
- Ignores redirections: Unlike
dirrename, this bypasses assignment file redirections - Zip archive support: Works with directories inside zip files
- Universal compatibility: Allowed in all component types
- Flexible paths: Supports both relative and absolute paths
💡 When to Use ldirrename
Use ldirrename when you:
- Need to rename directories without triggering file redirections
- Work with zip archives containing directories
- Want direct control over directory operations
- Need consistent behavior across different deployment environments
🔗 Related Functions
For comparison, check out the standard dirrename function if you need redirection-aware directory renaming.
Happy coding with Uniface! 🎉
Top comments (0)