I am trying to create named pipe in a directory which is created under clearcase's vobs tree (/vobs/something/something) but not checked-in. I am getting this error:
"mkfifo: No such device or address"
I am not able to understand why pipe creation is failing while other files are getting created.
I am using Solaris 10. Is there any way I can create named pipes in vobs?
/vobs/something/something means MVFS path with a view set (as in cleartool setview).
First, try the same operation with the fumm path instead of trying to set a view. As I explain in "Python and ClearCase setview", setting a view creates a sub-shell, with all kinds of side effect for your processes (in term of environment variables and other non-heirted attributes).
So try it in /views/MyView/vobs/something/something.
Second, regarding pipe, check if this thread applies to your case:
Just off the top of my head if you using a pipe and not a file, then it should be specified something like this ..
destination my_pipe pipe("/data/pipes/net_pipe");
rather than
destination my_file file("/data/pipes/net_pipe");
Note that, for ClearCase up to 7.0.x:
ClearCase does not support adding to source control special files such as named pipes, fifos or device files. There are no type mangers available to manage these special files.
Note: Attempts to execute these files in the MVFS is not supported.
WORKAROUNDS:
Keep multiple versions of directories with device files outside of a VOB and versioned directories/symlinks in a VOB to point to correct directory location outside the VOB.
Keep a tar or zip archive of the tree with device files in the VOB, and extract it to a temporary workspace when needed in the development process.
Related
I want to provide support to convert single-page and multi-page tiff files into PDFs. There is an executable in Bit Miracle's LibTiff.NET called Tiff2Pdf.
How do I use Tiff2Pdf in my application to convert tiff data stream (not a file) into a pdf data stream (not a file)?
I do not know if there is an API exposed because the documentation only lists Tiff2Pdf as a tool. I also do not see any examples in the examples folder using it in a programmatic way to determine if it can handle data streams or how to use it in my own program.
libtiff tools expect a filename so the background run shown below is simply from upper right X.tif to various destinations, first is default
tiff2pdf x.tif
and we can see it writes a tiff2pdf file stream to console (Standard Output) however it failed in memory without a directory to write to. However on second run we can redirect
tiff2pdf x.tif > a.pdf
or alternately specify a destination
tiff2pdf -o b.pdf x.tif
So in order to use those tools we need a File System to receive the file objects, The destination folder/file directory can be a Memory File System drive or folder.
Thus you need to initiate that first.
NuGet is a package manager simply bundling the lib and as I don't use .net your a bit out on a limb as BitMiricle are not offering free support (hence point you at Stack Overflow, a very common tech support PLOY, Pass Liability Over Yonder) however looking at https://github.com/BitMiracle/libtiff.net/tree/master/Samples
they suggest memory in some file names such as https://github.com/BitMiracle/libtiff.net/tree/master/Samples/ConvertToSingleStripInMemory , perhaps get more ideas there?
I have a configure script to set up some paths for my R package during installation. I wish to edit a file based on some conditions. Is there any way to edit a file from within the configure.ac? It would be great if the solution is provided for all operating systems.
Is there any way to edit a file from within the configure.ac?
configure.ac is not executable, but I suppose you mean that you want the configure script generated from it to edit a file. The configure script is a shell script, and you can cause arbitrary shell code to be included in it, more or less just by including that code at the corresponding point in configure.ac.
The question, then, is how you would automate editing a file with a shell script. There is a variety of alternatives, but sed is high on my list. You will find it on every system that can support Autoconf configure scripts, because such scripts use it internally.
On the other hand, this sort of thing is one of the main activities of a configure script, in the form of creating files (especially makefiles, but not limited to those) from templates. You should consider building your target file of interest from a template in this way, instead of making custom-programmed edits to a file packaged in your program distribution. This would involve
setting output variables containing the chosen content for the parts of the file that need to be configured;
designating the target file as one for configure to build; and
providing the template, maybe by taking a complete example file and replacing each variable part with a reference to the appropriate #output_variable#.
I'm new to R and frankly the amount of documentation is overwhelming, and I haven't been able to find the answer to this question.
I have created a number of .R script files, all stored in a folder that I can access on my server (let's say the folder is, using the Windows backslash character \\servername\Paige\myscripts)
I know that in R you can call each script individually, for example (using the forward slash required in R)
source(file="//servername/Paige/myscripts/con_mdb.r")
and now this script, con_mdb, is available for use.
If I want to make all the scripts in this folder available at startup, how do I do this?
Briefly:
Use your ~/.Rprofile in the directory found via Sys.getenv("HOME") (or if that fails, in R's own Rprofile.site)
Loop over the contents of the directory via dir() or list.files().
Source each file.
as eg via this one liner
sapply(dir("//servername/Paige/myscripts/", "*.r"), source)
but the real story is that you should not do this. Create a package instead, and load that. Bazillion other questions here on how to build a package. Research it -- it is worth it.
Far the best way is to create a package! But as first step, you could also create one r script file (collection.r) in your script directory which includes all the scripts in a relative manner.
In your separate project scripts you can than include only that script with
source(file="//servername/Paige/myscripts/collection.r", chdir = TRUE)
which changes the directory before sourcing. Therefore you would have only to include one file for each project.
In the collection file you could use a loop over all files (except collection.r) or simply list them all.
What does MVFS in a clearcase server?
MVFS (Multi-Version Filesystem) don't so much "create" a filesystem, but give you access to one.
M: (on Windows) or /view (on Unix) is a mounting point allowing to browse the content of any Vob (the ClearCase repositories) you mount (like a classic network mount, but made by ClearCase).
When you create a dynamic view, you will use MVFS to browse the "dynamic" filesystem, meaning you want load any file on your hard disk: you will remotely see any version you have selected through the config spec of the view.
See About the MultiVersion File System (MVFS):
The MultiVersion File System (MVFS) creates a virtual file system specifically designed for accessing data within a Rational ClearCase VOB.
The MVFS works similarly to UNIX® Network File System (NFS), in that it loads a kernel driver that presents a file system to the user through a standard interface within the Windows, UNIX or Linux kernel.
Notes:
a snapshot view won't use MVFS (see "What are the differences between a snapshot view and a dynamic view?")
With a dynamic view, you can directly browse any version you want, using extended pathnames.
Any read/write operation is done through cleartool and ClearCase: you cannot, as you tried in your previous question "rm doesn't detect failure of fchdir in walkfs", to rm elements through a Unix rm or Windows del. Only cleartool command can modify an element managed by ClearCase in a dynamic view.
I have tons of files dumped into a few different folders. I've tried organizing them several times, unfortunatly, there is no organization structure that consistently makes sense for all of them.
I finally decided to write myself an application that I can add tags to files with, then the organization can be custom to the actual organizational structure.
I want to prevent from getting orphaned data. If I move/rename a file, my tag application should be told about it so it can update the name in the database. I don't want it tagging files that no longer exist, and having to readd tags for files that used to exist.
Is there a way I can write a callback that will hook into the mv command so that if I rename or move my files, they will invoke the script, which will notify my app, which can update its database?
My app is written in Ruby, but I am willing to play with C if necessary.
If you use Linux you can use inotify (manpage) to monitor directories for file events. It seems there is a ruby interface for inotify.
From the Wikipedia:
Some of the events that can be monitored for are:
IN_ACCESS - read of the file
IN_MODIFY - last modification
IN_ATTRIB - attributes of file change
IN_OPEN and IN_CLOSE - open or close of file
IN_MOVED_FROM and IN_MOVED_TO - when the file is moved or renamed
IN_DELETE - a file/directory deleted
IN_CREATE - a file in a watched directory is created
IN_DELETE_SELF - file monitored is deleted
This does not work for Windows (and I think also not for other Unices besides Linux) as inotify does not exist there.
Can you control the path of your users? Place a script or exe and have the path point to it before the standard mv command. Have this script do what you require and then call the standard mv to perform the move.
Alternately an alias in each users profile. Have the alias call your replacement mv command.
Or rename the existing mv command and place a replacement in the same dir, call it mv and have it call your newly renamed mv command after doing what you want.