Difference between revisions of "TruxtonFileIO changetype"

From truxwiki.com
Jump to navigation Jump to search
Line 1: Line 1:
 
This changes the type of the file.
 
This changes the type of the file.
It modifies the <code>FileTypeID</code> column of the <code>[[File Table | File]]</code> table.
+
It modifies the <code>FileTypeID</code> column of the <code>[[File Table|File]]</code> table.
  
 
=Syntax=
 
=Syntax=
Line 8: Line 8:
  
 
=Return value=
 
=Return value=
[https://docs.python.org/3.8/library/constants.html?highlight=false#True True] if the <code>FileTypeID</code> column of the <code>[[File Table | File]]</code> table was modified, [https://docs.python.org/3.8/library/constants.html?highlight=false#False False] on failure.
+
[https://docs.python.org/3.10/library/constants.html?highlight=false#True True] if the <code>FileTypeID</code> column of the <code>[[File Table|File]]</code> table was modified, [https://docs.python.org/3.10/library/constants.html?highlight=false#False False] on failure.
  
 
=Sample=
 
=Sample=
 
+
<sourcelang="Python" highlight="7">
<syntaxhighlight lang="Python" highlight="7">
 
 
import truxton
 
import truxton
  
Line 20: Line 19:
  
 
   file.changetype(11000)
 
   file.changetype(11000)
 +
 +
  return None
  
 
if __name__ == "__main__":
 
if __name__ == "__main__":
 
   main()
 
   main()
</syntaxhighlight>
+
</source>

Revision as of 07:23, 1 October 2022

This changes the type of the file. It modifies the FileTypeID column of the File table.

Syntax

bool changetype(newtype);

Return value

True if the FileTypeID column of the File table was modified, False on failure.

Sample

<sourcelang="Python" highlight="7"> import truxton

def main():

 t = truxton.create()
 file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")
 file.changetype(11000)
 return None

if __name__ == "__main__":

 main()

</source>