Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_encode( <csource>, <ctarget> ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_ENCODE( <cSource>, <cTarget> )


Parameters

<cSource>
Name of the file to encrypt. May include a path to the file.

<cTarget>
Name of the resulting encrypted file. May include a path.


Returns

True if the operation was completed successfully. False if the file is 
already encrypted with the current key the file cannot be opened or 
cannot be found.


Description

A new, encrypted file is created using the name specified in <cTarget>. 
The source file is left unchanged to ensure that it remains uncorrupted 
if an I/O should occur during encryption. If encryption is successful, 
you can delete the encrypted source.

Before attempting to encode a file, you must first set the encryption 
key by calling N_SETKEY(). You must also ensure that the files being 
encoded are not open on any station, including the current one.

If you are encoding a DBF file, you should also encode the associated 
DBT or NTX files.


Example

// Encrypt a file and its associated DBT
N_SETKEY(cKeyValue)
IF N_ENCODE('clear.dbf', 'encode.dbf')
   ? 'CLEAR.DBF encrypted to ENCODE.DBF'
ELSE
   ? 'Encryption of CLEAR.DBF failed'
ENDIF
IF N_ENCODE('clear.dbt', 'encode.dbt')
   ? 'CLEAR.DBT encrypted to ENCODE.DBT'
ELSE
   ? 'Encryption of CLEAR.DBT failed'
ENDIF



See Also: N_DECODE() N_SETKEY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson