You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write files containing a UUID to memory cards inside cameras and phones so that I can identify a card that has been seen before when a device is plugged in.
This works:
`#!/usr/bin/python3
#Tag, untag and retag memory cards
import os
import sys
import gphoto2 as gp
from ctypes import *
def main():
cam = gp . Camera ()
cam . init ()
val, tfile = gp . gp_file_open ( "orig.uui" )
p = cam . folder_put_file ( "/store_00010001/DCIM", "elephant.uui",
gp . GP_FILE_TYPE_NORMAL, tfile)
main()
`
It copies a UUID from a text file created by uuidgen to the card in the camera.
However I have completely failed to write a UUID from a Python text string without going via a disk file. I have tried creating a file and using set_data_and_size() but have not found any combination of parameters that will work.
Is there somewhere an example program for set_data_and_size() ?
The text was updated successfully, but these errors were encountered:
I'm trying to write files containing a UUID to memory cards inside cameras and phones so that I can identify a card that has been seen before when a device is plugged in.
This works:
`#!/usr/bin/python3
#Tag, untag and retag memory cards
import os
import sys
import gphoto2 as gp
from ctypes import *
def main():
cam = gp . Camera ()
cam . init ()
val, tfile = gp . gp_file_open ( "orig.uui" )
p = cam . folder_put_file ( "/store_00010001/DCIM", "elephant.uui",
gp . GP_FILE_TYPE_NORMAL, tfile)
main()
`
It copies a UUID from a text file created by uuidgen to the card in the camera.
However I have completely failed to write a UUID from a Python text string without going via a disk file. I have tried creating a file and using set_data_and_size() but have not found any combination of parameters that will work.
Is there somewhere an example program for set_data_and_size() ?
The text was updated successfully, but these errors were encountered: