Is it necessary to nil a file after opening it?

Here’s how i open the files and write to them. Should i nil them? Does it really matter?

 \_path = system.pathForFile( "test.txt", system.DocumentsDirectory ) \_file = io.open( \_path, "w" ) \_file:write( testIt ) io.close( \_file ) \_file = nil \_path = nil

–SonicX278 

Is it necessary to nil the variable referencing (containing) the file handle?  

No.

But is it safer to do so?

–SonicX278

Makes no difference.

Also, define ‘safe’.

  • doesn’t free meaningful amount of memory

  • can’t access file after closed so not safer than closing

Alright. Thanks! --SonicX278

Is it necessary to nil the variable referencing (containing) the file handle?  

No.

But is it safer to do so?

–SonicX278

Makes no difference.

Also, define ‘safe’.

  • doesn’t free meaningful amount of memory

  • can’t access file after closed so not safer than closing

Alright. Thanks! --SonicX278