Advertisement

Datafile Transfer after Sequence Ends

Discussions about chromatography data systems, LIMS, controllers, computer issues and related topics.

3 posts Page 1 of 1
I am trying to use a macro to automatically copy datafiles to another location after the sequence has completed. The macro calls for a FileStat(MODE, DestDir$) command, but I am unable to succesfully define the MODE. Can anyone help or provide a list of variables?

The macro is as follows:

Author Niels Waleson
!Date 28 Oct 1997
!ChemStation G2070AA All version

!\usermacs\lc\38

!Not supported, request can be send to the author.

!This macro will copy during a sequence the files
! to a specified directory at the end of a run

!Load this file in \hpchem\core\user.mac
!Use in RunTime CheckList as PostRun command: SaveTo "E:\MYDATA"

Name SaveTo
Parameter DestDir$
!Step out if not in sequence
If _SequenceOn = 0 Then
Return
EndIf
!Create the destination directory
If FileStat(MODE, DestDir$) = -1 Then
MkDir DestDir$
EndIf
!Create the destination sequence sub directory
If FileStat(MODE, DestDir$ + "\" + _DataSeqSubDir$) = -1 Then
MkDir DestDir$ + "\" + _DataSeqSubDir$
EndIf
!If the datafile is already there write an error in the logbook
If FileStat(MODE, DestDir$ + "\" + _DataSeqSubDir$ + \
"\" + _DataFile$) = -1 Then
Copy _DataPath$ + _DataSeqSubDir$ + "\" + _DataFile$, \
DestDir$ + "\" + _DataSeqSubDir$ + "\" + _DataFile$
Else
WriteToLogBook "SaveTo error: File already exist"
WriteToLogBook DestDir$ + "\" + _DataSeqSubDir$ + "\" + _DataFile$
EndIf
Return
Here is the information about the FileStat command

Gets the status of the specified file or directory.

Group

File Manipulation Commands

Syntax

FILESTAT( Selector, Name )

Parameters Type/Description

Selector Keywords: SIZE, MODE, OPERM, GPERM, PERM, TIME
Name String expression evaluating into a valid filename or directory name

Discussion

Function returns specific status information of the specified file or directory depending on the given Selector. The selectors cannot be abbreviated. A filename or directory name without absolute path is specified from the applications current working directory. Wild characters as part of filename or directory name are not allowed.
Depending on the selector the following states of the file can be retrieved:

SIZE Returns the size of the file specified in bytes. For Directories 0 is returned always.
MODE Returns the following information :

-1 = file/directory not found
1 = regular file
2 = directory
3 = character special
(4 = block special -- never returned in this version)
(5 = fifo -- never returned in this version)

PERM Returns the permission of a file. For Directories 7 is returned always.

-1 = File/directory not found.
0 = No permission set on file.
1 = Execution permission (for named application).
2 = Write permission (for named application).
3 = Write and execution permission (for named application).
4 = Read permission (for named application).
5 = Read and execution permission (for named application).
6 = Read and write permission (for named application).
7 = Read, write and execution permission (for named application).
( In this version OPERM, GPERM return the same as PERM )

TIME Returns time of the last modification of the file/directory. The value is the calendar time in seconds.

Return Value

Number, interpretation depends on Selector.

Copyright (c) 1990-2002 Agilent Technologies


Gasman
Thank you for your response!! I will try this.
3 posts Page 1 of 1

Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 5 minutes)
Most users ever online was 4374 on Fri Oct 03, 2025 12:41 am

Users browsing this forum: No registered users and 35 guests

Latest Blog Posts from Separation Science

Separation Science offers free learning from the experts covering methods, applications, webinars, eSeminars, videos, tutorials for users of liquid chromatography, gas chromatography, mass spectrometry, sample preparation and related analytical techniques.

Subscribe to our eNewsletter with daily, weekly or monthly updates: Food & Beverage, Environmental, (Bio)Pharmaceutical, Bioclinical, Liquid Chromatography, Gas Chromatography and Mass Spectrometry.

Liquid Chromatography

Gas Chromatography

Mass Spectrometry