copying .tar.gz file while writing it [closed] - unix

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is writing a .tar.gz file purely sequential?
When copying a large file, I started compressing it, and while it was compressing, scping it to a different machine. Afterwards I checked the md5sum on both machines, and they did not match. I guess it wasn't the best idea ever to start reading the .tar.gz before it was finished. I supposed that writing that .tar.gz file would only append to the end so that reading it would work out fine.
Does anybody know anything about the mechanics of this? What specifically is happening here?

If you were doing to scp with a simple .tar file, it could work.
tar is a sequential archiving tool mostly designed to be piped to cpio to write on a tape.
But here, you ask tar to first create the archive and then compress it. The compression can happen only after the archive is finished.

Related

How to convert a SAS (.sas) file to be opened in R? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
This post was edited and submitted for review 1 year ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I received a SAS file (.sas), but I don't have a SAS license, would it be possible to open this file in R using some package in a simple way?
With the .sas file open in R I intend to access the database that is associated with it. I could do this using a temporary SAS license, but for me it will be too bureaucratic to do so, and I am more familiar with R which is 100% free.
NOTE: I can't share the file because it's third-party data.
In RStudio, in the Files pane navigate to the file you'd like to open.
Click on the file and select View File and it will open.
.SAS files are text files that store programs they typically do not create data unless it's a data step that has data.

How does UNIX handle a move of a file between two disk file systems? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have three directories on a UNIX box, as described below:
/tmp mapped on /dev/mapper/data-tmpVol1
/var mapped on /dev/mapper/data-varVol1
/opt mapped on /dev/mapper/data-optVol1
If I perform a move operation from /tmp to /var, will the UNIX do in fact a copy since there are two different file systems behind scene?
If I want an instant move, is it better to copy the file first in a /var/staging and perform a move from /var/staging to /var/input?
Context around the issue: I have a process which scans for files in /var/input, and I've seen cases when it picked up half-copied files (when moving directly from /tmp to /var/input).
Regards,
Cristi
When moving across file systems, you may like to create a file in the destination directory with a temporary filename, e.g. my-file.txt~. The scanning process must ignore such temporary filenames. When the file is complete you rename it to the final name. This way when the file (with a final name) exists it is complete, or it doesn't exist at all.

Why can't I change directory [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to move directory to another directory.
But I can't only change include directory which includes header files for database in C programming.
First, I typed "mv include /usr/include" in terminal so that change directory.
Then Error message shows up which says "rename mysql.h to usr/include Operation not permitted".
I want it for #include .
Could you please help me to find solution?
Best regards,
Don't try to move your include files to the system include directory - it's read only.
Instead, use the command line -I argument to force the compiler to check your directories as well as the system ones e.g.
cc -I/path/to/my/sql/includes mycprogram.c
You'll probably find you also need to use the -L and -l switches at some point soon.

How does StackOverflow (and other sites) handle orphaned uploads? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've been wrestling with a problem related to allowing users to upload files to my web server through a web page. How can I prevent uploaded files from being "orphaned" as a result of uploading and forgetting.
For example, when I create a question on StackOverflow, I have the option of adding an image to my question. This uploads the file and provides a URL to the resource on an SO server. What if I upload a file, but never submit my question (either I changed my mind, or my computer crashed, or I just closed the browser, etc...). Now there's a file on the SO server that isn't being used by anything. Over time, these could build up.
How can I handle this? Would some background process / automated task that performs checks for unused or expired files be sufficient? Maybe I'm over complicating this?
I can't speak for SO, but the way I've always done it is to run a scheduled task (e.g. cronjob) that goes through the database, looks for orphaned files that don't match entries in the uploads table, and whose creation date is older than 24 hours.
Secondly, having files upload to /tmp or %temp%\ first and then copy over to a proper uploads directory does wonders for this kind of thing - a half finished upload can be left orphaned, and the OS will automagically clear it up when there are no longer any handles to it.

removing a file in unix [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
In a UNIX filesystem, if the inode of the root directory is in the memory, what are the sequence of disk operations needed to remove a file in Desktop?
While I am trying to solve a question in textbook, I have seen this question but I could not solve it . Can anyone help me ?
If you know much about Unix, can you tell me what are sequence of disk operation needed for creating a file in Desktop ?
Use rm to remove files in Unix. e.g.,
rm file_to_delete
or better yet if you are uncertain about working in Unix
rm -i file_to_delete
which will prompt with the name of the file to be deleted to confirm the operation.
The file_to_delete can be in the current directory, or in some other directory as long as the path is properly specified.
See rm man page for more information.
As for creating a file, you can create an empty file with the touch command. I.e.,
touch some_file
will create an empty file named some_file. Again, this can be in the current directory, or any directory with the path specified.
For more information see the touch man page.
Your questions wasn't quite clear to me, so if this doesn't answer it please add a comment or (better yet) consider possibly rephrasing your original question or at least the title of your question (removing a file in unix)

Resources