Jump to content

check file


Go to solution Solved by ad777,

Recommended Posts

Hello everyone, I have the following problem I have a code where I verify when starting the GUI if a file exists and if it actually exists, write the following name in the txt file adding the following symbol to the end of the text | so that the listbox can read the information of the document, but this does not work.

 

Func Comprobar()
   Local $sFilePath = ("datos")
   Local $iFileExists = FileExists($sFilePath)
   If $iFileExists = ("BR2.cue") Then
         FileWrite ("info\List.txt", "Lenovo")
         EndIf
   EndFunc

 

Edited by benjamindh
Link to comment
Share on other sites

  • Moderators

Yes, and that is never going to work. You need to go back and read the help file for FileExists, and what it returns to understand why $iFileExists will never equal "BR2.cue"

 

Edit: Or you could just wait for someone to give you the answer...

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

benjamindh your code should be :

Func Comprobar()
   Local $sFilePath = ("datos")
   If FileExists($sFilePath) Then
         FileWrite ("info\List.txt", "Lenovo")
         EndIf
   EndFunc

 

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to comment
Share on other sites

5 minutes ago, ad777 said:

benjamindh your code should be :

Func Comprobar()
   Local $sFilePath = ("datos")
   If FileExists($sFilePath) Then
         FileWrite ("info\List.txt", "Lenovo")
         EndIf
   EndFunc

 

hello, I need to check if the BR2.cue file exists in the folder since there are several files in that folder and if it exists write lenovo in the txt document

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...