Unable to read a .any file within a tar file using apache-vfs-2.2 - tar

I am trying to read the contents of a .any file which is compressed in a tar file, using groovy script. It is using apache-vfs-2.2
Eg : /path/to/abcd.tar!/path/to/xyz.any
The error notified:
org.apache.commons.vfs2.FileSystemException: Could not read from
"tar:file:///path/to/abcd.tar!/path/to/xyz.any" because it is not a
file.
NOTE : Other file types like txt, pom, html, etc are possible. The issue exists with only .any files within the tar.
Could anyone have any suggestions here?

Related

How to read a xml file which is not well_formed?

I am trying to read an XML file with xml.etree.ElementTree
it gives me an error when it reaches a specific line of the file. I was assuming that this is a regular XML file. please help me how can I resolve it?
xml_file =ET.parse("/Users/arash/project/my_project/extracting_features/TraceData.log").getroot()

In MediaToolkit output file not saved in the specified directory path in the asp.net core with docker

When I try to convert video using MediaToolkit in the local system, then it's working fine, but the same project when I run in docker then output file not saved in the given path.
Also, the output file is not saved in the directory so I am getting null metadata.
Here is my code
using (var engine = new Engine())
{
engine.Convert(inputFile, outputFile, conversionOptions);
engine.GetMetadata(outputFile);
engine.Dispose();
}
FileInfo outputFileInfo = new FileInfo(outputFile.Filename);
Error - Could not find file '/app/e77f2017-ef6e-4115-ba00-73a5c09941a9.mp4'
Can anyone please help me with this?
check the current path (you are working relative)
the program might not run from you think and then "app" directory is not found.

Zipping a folder

I am trying to use
TZipFile.ZipDirectoryContents()
Like so:
TZipFile.ZipDirectoryContents('Test.PCF', WorkingDir);
If I am reading this right, it should save the contents of folder "workingdir" into a file named Test.pcf.
Now when I do this I get error::
Raised exception class EFOpenError with message Cannot open file
...test.pcf. The process cannot access the file because its being used by another process."
Two things confuse me:
It says that it cannot open file. There is no test.pcf yet. I was hoping this would create it.
It says cannot access file. Is this because it's not created yet? Am I using this function wong? If so how would I create a zip file from a folder location?
I tested your code and it failed in the same way as you reported.
I then created an empty zip file manually by running WinZip.
Then ran your code and it ran fine.
It appears that the zip file has to already exist for ZipDirectoryContents to work.
To create a zip file programatically:
myZipFile := TZIpFile.Create;
myZipFile.Open('c:\myfolder\newzipfile.zip', TZipMode.zmWrite);
myZipFile.Close;
myZipFile.Free;
This line will then work:
TZipFile.ZipDirectoryContents('c:\myfolder\newzipfile.zip', WorkingDir);

ILASM does not set FileVersion

I have an .il file which I can compile without any problems. I can strong name it and so without any issues. But I am not able to set the file version via the attribute as I would expect it. How can I set the FileVersion for an assembly when using ilasm?
If I do a round trip I get always a .res file which does contain only binary data which is not readable. What is inside this res file and can I edit it?
The code does not work
.assembly myAssembly
{
.custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = { string('1.2.3.4') }
The issue can be solved by using the .res file. It is not sufficient to do a round trip with ildasm and ilasm. The IL file does not reference the .res file. I had to add it to the ilasm call manually. The data in the res file seemed to contain the infos which are written into the PE header which is ok for me.
The final command line needed was
ilasm test.il /dll /res:test.res
I still do not know what exactly is inside the res file but I can exhange it with the meta data information of any other assemlby that I create manually and then decompile it to replace the metadata of the original assembly as I need.
It seems not many people are doing such stuff.

unzOpen returns null while unzipping tz file in iphone

I am using ZipArchive to unzip tz files in my iphone App. It works fine when I have a sample tz file which contains text files inside it. However, my main usage is to try to unzip a tz file containing Json files. When I try to do that nothing happens as I am not able to access my file and I am not coming to a conclusion regarding to what am I doing wrong here?
Only thing I have come to know is this
_unzFile = unzOpen( (const char*)[zipFile UTF8String] );
This line of code returns me a proper _unzFile and works fine with the sample .tz file which contains .txt files. However, when I try it with my .tz file which contains a json file in it, _unzFile contains nothing (i.e 0x0). Is there any problem with UTF8String function? Or else what am I doing wrong?
Please help! Thanks.
Generally it is the problem of the zip file to be uncompressed. In my condition, I used some other files, compress them manually and decompress them with the code, the unzOpen works properly. I used ASIHTTPRequest, downloaded and renamed the zip file, I suppose it could be made wrong here. Therefore, check the zip file itself please.

Resources