Mapping Between mox.file and Local APIs and Switchover
API Mapping
- Python: local file operation APIs of Python. The APIs can be shifted to the corresponding MoXing file operation APIs (mox.file) by one click.
- mox.file: file operation APIs of MoXing Framework. The APIs correspond to the Python APIs.
- tf.gfile: TensorFlow APIs with the same functions as MoXing file operation APIs. In MoXing, file operation APIs cannot be automatically switched to TensorFlow APIs. The following table lists only the APIs with similar functions.
Python (Local File Operation API) |
mox.file (MoXing File Operation API) |
tf.gfile (TensorFlow File Operation API) |
---|---|---|
glob.glob |
mox.file.glob |
tf.gfile.Glob |
os.listdir |
mox.file.list_directory(..., recursive=False) |
tf.gfile.ListDirectory |
os.makedirs |
mox.file.make_dirs |
tf.gfile.MakeDirs |
os.mkdir |
mox.file.mk_dir |
tf.gfile.MkDir |
os.path.exists |
mox.file.exists |
tf.gfile.Exists |
os.path.getsize |
mox.file.get_size |
- |
os.path.isdir |
mox.file.is_directory |
tf.gfile.IsDirectory |
os.remove |
mox.file.remove(..., recursive=False) |
tf.gfile.Remove |
os.rename |
mox.file.rename |
tf.gfile.Rename |
os.scandir |
mox.file.scan_dir |
- |
os.stat |
mox.file.stat |
tf.gfile.Stat |
os.walk |
mox.file.walk |
tf.gfile.Walk |
open |
mox.file.File |
tf.gfile.FastGFile(tf.gfile.Gfile) |
shutil.copyfile |
mox.file.copy |
tf.gfile.Copy |
shutil.copytree |
mox.file.copy_parallel |
- |
shutil.rmtree |
mox.file.remove(..., recursive=True) |
tf.gfile.DeleteRecursively |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot