| T O P I C R E V I E W |
| peter.cook |
Posted - 05/28/2004 : 08:50:32 AM HI,
I want to save all graphs created within an origin application via LabTalk and C to a single folder. However, many will have identical default names.
One approach is to see if a file of that name exists and if so append eg v2, v3 to the file name. Okay, no problem.
I was wondering if it might be quicker to trap this as an error when saving then trying with eg v2,v3 appended to the file name. If so, how could this be done.
NB This would be over a network.
Cheers,
pete
|
| 2 L A T E S T R E P L I E S (Newest First) |
| peter.cook |
Posted - 05/28/2004 : 12:17:12 PM Hi MIke,
Nice (simple) idea - I'll look into it.
cheers,
Pete
|
| Mike Buess |
Posted - 05/28/2004 : 11:12:03 AM Hi Pete,
Not sure how about the best way to incorporate this into error handling or about the implications of network paths, but an easy way to deal with duplicate file names is with get_next_file_name().
Global Functions->File Management
bool get_next_file_name(string& strFilename, bool bCheckCreatePath = true)
Example:
string str = GetAppPath() + "origin.ini"; get_next_file_name(str); out_str(str);
>>C:\Origin75\User\origin1.ini
Mike Buess Origin WebRing Member |
|
|