How to make a file live which is previously defunct - accurev

There was a defunct file in a stream. I just revert it to backed version in stream, now i can't see that file, what happened to the actual file? how do i obtain it?

Since that file was in 'defunct' state, when i clicked 'revert to backed version', it got removed from the stream (the purge).
I was able to bring that file back to stream. It is still in 'defunct' state, however the version is increased by 1.
Here are the steps that I followed to bring it back to stream:
Get the eID (element ID) of the file - to get this, browse to stream and see the history- you should be able to see transaction as 'purge' for this file. From properties of the file, you'll get eID.
In command prompt, change to work-space directory of the stream where you reverted the file. Type the below command:
accurev co -v <\stream_name>\1 -e <\ID>
where:
<\stream_name>\1" is the latest version of the file.
<\ID> is eID.
Go to work-space through GUI, you should now able to see the file. Now it should be promoted to appear in stream.

Related

How to copy a file without extension and at the end of the copy put it?

I am using teracopy to move some files. I would like to make a form in visual * .exe where you simply have two windows: one with the file's origin on the right, and another with the file's destination.
I need to copy the file without its extension, verify that the transfer occurred without issue, and then restore the original extension. For example:
Copy file.mov to // smb: Storage / Movies /
Remove the .mov extension
Copy the file to the storage location
Validate file size
If the file size at the destination matches the source, restore the .mov extension
If the file size doesn't match, delete the destination file and notify the user of the error.
The files I plan to copy are very large, and will take a good amount of time. I'm removing the extension so that users on the server will not accidentally try to access a file that isn't completely transferred yet - the idea is they see an "extensionless" file and know not to try and open it, whereas any files with extensions are certain to have copied over correctly.
I've tried using CMD and powershell, but I've only managed to copy the file or retry copying if the copy fails. I don't yet know how to remove the extension and restore it.
> ROBOCOPY /Mir <Source> <Target>
You can try this:
copy %UserProfile%\YourFile.* "Path to copy to"

docx to pdf conversion with libreoffice

I downloaded libreoffice to try to convert docx to pdf. Having a hard time getting it to run. I've looked around on forums and it seems the command is
soffice --convert-to pdf filename.docx
or
libreoffice --convert-to: pdf:writer_pdf_Export filename.docx
soffice is the command I have that works, as the .exe. I'm navigating to where the .exe is and trying to run it there. I'm getting the following error.
C:\Program Files\LibreOffice\program> soffice convert-to pdf C:\Users\mwolfe\OneDrive - Company Inc\doc_converter\test_file.doc
LibreOffice 6.1.4.2 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
Error in option: -
Usage: soffice [argument...]
argument - switches, switch parameters and document URIs (filenames).
Using without special arguments:
Opens the start center, if it is used without any arguments.
{file} Tries to open the file (files) in the components
suitable for them.
{file} {macro:///Library.Module.MacroName}
Opens the file and runs specified macros from
the file.
Getting help and information:
--help | -h | -? Shows this help and quits.
--helpwriter Opens built-in or online Help on Writer.
--helpcalc Opens built-in or online Help on Calc.
--helpdraw Opens built-in or online Help on Draw.
--helpimpress Opens built-in or online Help on Impress.
--helpbase Opens built-in or online Help on Base.
--helpbasic Opens built-in or online Help on Basic scripting
language.
--helpmath Opens built-in or online Help on Math.
--version Shows the version and quits.
--nstemporarydirectory
(MacOS X sandbox only) Returns path of the temporary
directory for the current user and exits. Overrides
all other arguments.
General arguments:
--quickstart[=no] Activates[Deactivates] the Quickstarter service.
--nolockcheck Disables check for remote instances using one
installation.
--infilter={filter} Force an input filter type if possible. For example:
--infilter="Calc Office Open XML"
--infilter="Text (encoded):UTF8,LF,,,"
--pidfile={file} Store soffice.bin pid to {file}.
--display {display} Sets the DISPLAY environment variable on UNIX-like
platforms to the value {display} (only supported by a
start script).
User/programmatic interface control:
--nologo Disables the splash screen at program start.
--minimized Starts minimized. The splash screen is not displayed.
--nodefault Starts without displaying anything except the splash
screen (do not display initial window).
--invisible Starts in invisible mode. Neither the start-up logo nor
the initial program window will be visible. Application
can be controlled, and documents and dialogs can be
controlled and opened via the API. Using the parameter,
the process can only be ended using the taskmanager
(Windows) or the kill command (UNIX-like systems). It
cannot be used in conjunction with --quickstart.
--headless Starts in "headless mode" which allows using the
application without GUI. This special mode can be used
when the application is controlled by external clients
via the API.
--norestore Disables restart and file recovery after a system crash.
--safe-mode Starts in a safe mode, i.e. starts temporarily with a
fresh user profile and helps to restore a broken
configuration.
--accept={UNO-URL} Specifies an UNO-URL connect-string to create an UNO
acceptor through which other programs can connect to
access the API. UNO-URL is string the such kind
uno:connection-type,params;protocol-name,params;ObjectName.
--unaccept={UNO-URL} Closes an acceptor that was created with --accept. Use
--unaccept=all to close all open acceptors.
--language={lang} Uses specified language, if language is not selected
yet for UI. The lang is a tag of the language in IETF
language tag.
Developer arguments:
--terminate_after_init
Exit after initialization complete (no documents loaded).
--eventtesting Exit after loading documents.
New document creation arguments:
The arguments create an empty document of specified kind. Only one of them may
be used in one command line. If filenames are specified after an argument,
then it tries to open those files in the specified component.
--writer Creates an empty Writer document.
--calc Creates an empty Calc document.
--draw Creates an empty Draw document.
--impress Creates an empty Impress document.
--base Creates a new database.
--global Creates an empty Writer master (global) document.
--math Creates an empty Math document (formula).
--web Creates an empty HTML document.
File open arguments:
The arguments define how following filenames are treated. New treatment begins
after the argument and ends at the next argument. The default treatment is to
open documents for editing, and create new documents from document templates.
-n Treats following files as templates for creation of new
documents.
-o Opens following files for editing, regardless whether
they are templates or not.
--pt {Printername} Prints following files to the printer {Printername},
after which those files are closed. The splash screen
does not appear. If used multiple times, only last
{Printername} is effective for all documents of all
--pt runs. Also, --printer-name argument of
--print-to-file switch interferes with {Printername}.
-p Prints following files to the default printer, after
which those files are closed. The splash screen does
not appear. If the file name contains spaces, then it
must be enclosed in quotation marks.
--view Opens following files in viewer mode (read-only).
--show Opens and starts the following presentation documents
of each immediately. Files are closed after the showing.
Files other than Impress documents are opened in
default mode , regardless of previous mode.
--convert-to OutputFileExtension[:OutputFilterName]
[--outdir output_dir] [--convert-images-to]
Batch convert files (implies --headless). If --outdir
isn't specified, then current working directory is used
as output_dir. If --convert-images-to is given, its
parameter is taken as the target MIME format for *all*
images written to the output format. If --convert-to is
used more than once, the last value of OutputFileExtension
[:OutputFilterName] is effective. If --outdir is used more
than once, only its last value is effective. For example:
--convert-to pdf *.odt
--convert-to epub *.doc
--convert-to pdf:writer_pdf_Export --outdir /home/user *.doc
--convert-to "html:XHTML Writer File:UTF8" *.doc
--convert-to "txt:Text (encoded):UTF8" *.doc
--print-to-file [--printer-name printer_name] [--outdir output_dir]
Batch print files to file. If --outdir is not specified,
then current working directory is used as output_dir.
If --printer-name or --outdir used multiple times, only
last value of each is effective. Also, {Printername} of
--pt switch interferes with --printer-name.
--cat Dump text content of the following files to console
(implies --headless). Cannot be used with --convert-to.
--script-cat Dump text content of any scripts embedded in the files to console
(implies --headless). Cannot be used with --convert-to.
-env:<VAR>[=<VALUE>] Set a bootstrap variable. For example: to set
a non-default user profile path:
-env:UserInstallation=file:///tmp/test
I can't figure out what I'm doing wrong.
You need to add -- for commands and quotes around paths
first ensure you can open the doc from the command line. start with:
"C:\Program Files\LibreOffice\program\soffice.exe" "C:\Users\mwolfe\OneDrive - Company Inc\doc_converter\test_file.doc"
Then try the export command:
"C:\Program Files\LibreOffice\program\soffice.exe" --convert-to pdf "C:\Users\mwolfe\OneDrive - Company Inc\doc_converter\test_file.doc"
However with the latest libre office I'm not able to get any conversion working for me in windows command line.

Synchronize virtual file to the physical file in the Intellij IDEA plugin

I'm implementing the plugin for Intellij IDEA that needs file to be saved before executing action. Action is shell command, it requires file name to be passed as the command-line parameter.
AFAIK Idea saves (synchronizes) files on frame deactivation, so if I right-click on the file, and click on my action - old version of file will be used. If I go to other window, return to Idea and click my action - current version of the file will be used.
I've read this doc about Virtual File System, and found that I can trigger file to be loaded from file system (e.g. VirtualFileManager.syncRefresh() or VirtualFileManager.asyncRefresh()). I tried this hoping it would work, but it doesn't.
Question is: how to manually (programmatically) save file?
While formatting my question I checked one more time, and this worked for me.
FileDocumentManager.getInstance().saveAllDocuments();
EDIT
Finally came up with the solution
FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
Document document = fileDocumentManager.getDocument(file);
if (document != null) {
fileDocumentManager.saveDocument(document);
}

Read Permission without unlock dialog

I want to open some file from my application, file are created by the application itself and can have read or write permission.
I set read permission file with:
chmod 400 path
I want read permission file don't show unlock dialog when the user try to edit such files.
Is there any FS flags that can help me?
I just notice that if I try to change the owner of the file, the annoying dialog disappear, and the user can just duplicate the file in another place. This is exactly what I'm looking for but, is this the correct way to block a file?
Here 2 images about the involved dialogs
If the file only have read permissions, then it must be that the file system will ask for a password if the owner (or someoneelse) tries to change the file. Normally, one cannot change the owner of a file to some other owner ; that would be a major security hole.
Maybe what you are looking for is the stationary flag ? This will force a user to duplicate the file to work with it, but reading it should be no problem. You get that easily in the finder from the info window for a given file.
This is not a standard unix flag but a hfs thing. You will have to set this using NSFileManager and the method
setAttributes:ofItemAtPath:error:

Squeak Win 7 Error: No content to install

So I decided to take a look at Smalltalk. Googling led me to Squeak and Squeak By Example. Squeak By Example tells me to drag the .image file onto the Squeak.exe icon. I do this and get an error:
"Error: No content to install"
If I load squeak.exe by itself, no error message occurs. I assume this is because it uses the image file that was included in the download from squeak.org instead of the on I'm trying to use. I've verified that the .image and .changes files are not read only and are unblocked (you know, that little button that exists on the properties dialog of a file that was downloaded from the internet).
Squeak version: Squeak-4.2-All-in-One
SBE: 1.3
What's next?
Edit:
Proceeding with the book a bit, I got to the part where you save the environment, then try to open your recently saved image. I got the same error. So it must be an issue with how I'm opening it, or an permissions thing or something. I made sure both my user and the system user have full control over the image and changes files. I also tried forcing squeak.exe to run as administrator. Still having problems.
Saving the default image while exiting instead of a save-as and simply loading squeak.exe (and the default image) worked without error. I'll look at it some more later.
It seems that when an ImageFile is specified in Squeak.ini (as is the case in Squeak-4.2-All-in-One) that image file is always used. And if you pass a file as an argument to Squeak.exe (or drag and drop it) that file is passed to the image as a source file to be executed instead.
If you want to open an image file by dropping it on the Squeak.exe icon remove the ImageFile directive from Squeak.ini