Well, technically you can do so if for some reason you have to use a path (for instance if a submodule requires that), but it's pointless to re-open a FD that you already have...
If you want a python file object you can use os.fdopen, otherwise you can use the fd directly. I'd suggest you have a look at the google drive command that the Stanford Research Computing Group developed for lhsmtool_cmd, it's an excellent example: https://github.com/stanford-rc/ct_gdrive Henri On 08/nov. - 14:20 Alasdair King wrote: > Hi Henri, thanks for geting back to me. I had managed to get DD to > work with the cmd, but I had to locate the file discripter in the fd > directory in proc ( dd if=/proc/self/fd/{fd} ). If im writing a tool > in python is it expected for the FD to be handeld in a similler > fashion? > > Kind Regards > - Alasdair King > Research Computing Specialist > University Information Services > Roger Needham Building > JJ Thompson Avenue > University of Cambridge > Cambridge > Email: [email protected] > Tel: +441223746559 > > > On 8 Nov 2017, at 12:54, Henri Doreau <[email protected]> wrote: > > > >> Hi I am looking to make use of the lhsmtool_cmd, and im having trouble > >> understanding the use of the FD(File Descripter) varable requierd by > >> the tool. Is there anyone that can assist with my understanding? I'v > >> had a look unsuccessfully and at some examples, as well as run the > >> example with DD. > >> > >> Kind Regards > >> > >> - Alasdair King > > > > Hi, > > > > The FD is a file descriptor (integer) where the subprocess (the command > > which is spawned by the copytool) can read or write - depending whether > > it is archiving or restoring - data in Lustre. > > > > It is opened by the parent process, which receives and processes > > requests from the coordinator and passed to the subcommand so that it > > does not have to re-open the file. Internally, it is provided by > > llapi_hsm_action_get_fd(). > > > > Because we want to be able to invoke arbitrary commands, we cannot use > > the standard sendmsg/recvmsg to pass FDs between processes and instead > > rely on /proc/self/{fd} to work with commands that expect paths, like > > dd. > > > > Hope this makes sense > > Regards > > > > -- > > Henri > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ robinhood-support mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/robinhood-support
