LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  BRAINScript Copy File Function

    Employee
    Posted 11-08-2015 21:50

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: arkore

    I can see that I can use moveFile(from,to) to move a file around on the disk. Is there a way to ask it to retain the original and create a copy. I can see there is no copyFile(from,to) command but perhaps there is some other way to achieve the same effect?


  • 2.  RE: BRAINScript Copy File Function

    Employee
    Posted 11-09-2015 09:40

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rpigneri

    Dear arkore,

    Take a look at the appendFile function. If the target file does not exist, then the source file is simply copied to the new location. You can use the stat function to ensure that the target file does not exist if you have concerns about the target filename already existing.

    Hope that helps,

    Rocco


  • 3.  RE: BRAINScript Copy File Function

    Employee
    Posted 11-09-2015 15:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: arkore

    Hi Rocco,

    This is exactly the kind of thing I was looking for. Thanks very much.

    For anyone following me:
    In my case I intend to use the stat() function to check if the target file exists and if so then use the delete() function to clear the prior file then use appendFile() to copy. This replicates the copy and replace behavior that most file systems would use.

    Thanks!