Create Directories with NER

F_Papineau

Active Member
I need to do this procedure in a NER Business Function that I made :
Given the Directories C:\Temp as an example
1- Check if C:\Temp exists
2- If not, create it, else do nothing.

I also need a Business Function to get the Last Modified Date of any kind of files such as .txt, .pdf, .doc ... example: C:\Temp\R43500.pdf

Thanks!
 
You can use B0500180 to check if a file/directory exists.

You can create a BSFN that calls the windows API GetFileAttributesEx. This will report the last time the file was modified, among other things. It can be researched at www.msdn.com. This will only work on windows, but since your example referenced c:\temp, it doesn't seem that would be a problem for you.
 
Thank you for the tip ag_cjc

I will try this and post my results and conclusions later for those interested.

I am gonna start my research on msdn for GetFileAttributesEx

Thank you.
 
take a look at the following BSFN - B9600415 (it allows you to search for and select a particular path/directory on the work station), it may prove useful for whatever you're going to end up doing, enjoy ;)

ps - I think B9600410 would work for your specific request...
 
Re: Create Directories with NER - Conclusions

With the help of Casey and kavehm, create a directory under Windows appeared to be very simple. Here's the procedure to create "C:\Temp" directory as an example :

evt_TargetDirectory
evt_ErrorCode

VA evt_TargetDirectory = "C:\Temp"
//
// Check Directory existence with BSFN B0500180-OpSysFileOperations
Operating System File Operations Delete, Rename, File Exists
"E" -> cActionCode
VA evt_TargetDirectory <> szFileName1
UNDEFINED <> szFileName2
UNDEFINED -> cSetOneWorldErrorFlag01
VA evt_ErrorCode <- mnErrorCodeReturned
//
// Error Code returned :
// 0 = File or Directory exists
// 1 = File or Directory doesn't exist
If VA evt_ErrorCode is equal to "1"
//
// Create Directory with BSFN B9600410-CreateDirectoryPath
CreateDirectoryPath
VA evt_TargetDirectory -> szDirectory
End If
 
Back
Top