Hello
How can I find if a given file exist in a directory and if not, create one
G:\Users\Utilisateur\Documents\Bourse\Text_On_Chart\EUR.JPY_4_Hrs.txt
Martin
How to find if File exist and if not create it [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: How to find if File exist and if not create it
The PRINT command should do that for you.Hello
How can I find if a given file exist in a directory and if not, create one
G:\Users\Utilisateur\Documents\Bourse\Text_On_Chart\EUR.JPY_4_Hrs.txt
Martin
Re: How to find if File exist and if not create it [SOLVED]
Print(File("C:\test.txt"),CurrentDate,CurrentTime);The PRINT command should do that for you.Hello
How can I find if a given file exist in a directory and if not, create one
G:\Users\Utilisateur\Documents\Bourse\Text_On_Chart\EUR.JPY_4_Hrs.txt
Martin
File("PathFilename") - Specifies an ASCII file as the output target; if the specified file does not exist, the file will be created.
I learn something... I never new that I could do that with the print command
I will go to bed less dummy...
Martin
Re: How to find if File exist and if not create it
TJ's suggestion will work. Additional note: one issue with print() is that it will truncate existing file and so if you want to avoid that and still want to know if a file already exists, use ELC.PathExists().
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times