Is naming a file with two dots such as "..file" documented to move the file to the parent directory, or is this a bug? - macos-big-sur

If I name a file something like "..filename" it moves the file to the parent directory. I'm a security researcher and this is something I wasn't expecting. Seems like it's a bug but I haven't been able to find much info about it so I was hoping somewhere here could let me know if this is documented behavior or not. Thanks.

Related

Need help understanding a move script written for CMD involving multiple subdirectories into one directory

I got a folder with a lot of images in it, and I'd like to move everything to the main folder so basically I would like to turn this:
L:\Pixiv\Tags\44324\Image1.jpg
L:\Pixiv\Tags\4564356\Image2.jpg
L:\Pixiv\Tags\325423\Image3.jpg
L:\Pixiv\Tags\16324\Image4.jpg
...into this
L:\Pixiv\Tags\Image1.jpg
L:\Pixiv\Tags\Image2.jpg
L:\Pixiv\Tags\Image3.jpg
L:\Pixiv\Tags\Image4.jpg
I did some looking, and I discovered a move function for CMD, and while most of it I can understand, some of it I can't, and frankly, I'm just that smart enough to know what happens when you start playing around with stuff you don't fully understand, so I don't do it. Point is your basic move function is basically something like "move c:\Whatever C:\Whocares," but as you can tell from below, this is a little more complicated.
for /r %d in (*) do move "%d" "d:\all snaps\"
/r I think goes through all the folders at the current target directory. So if I'm in L:\Pixiv\Artists and I type in this code for L:\Pixiv\Artists as a destination folder every file in Artists is going to be dumped into Tags. Is this correct?
%d I couldn't make sense out of, so I've no idea what it does. Also, for ease of use, I would like to put this in a batch script, because boy howdy, do I got a lot of folders that needs to be fixed. From what little I was able to read I should write the same as above, but change %d to %dd, correct? Also where at would I add a target directory, so I could just write a batch script, and be done with it? Also, apologies in advance for my lack of knowledge, usually I use Batchrun when it comes to automating stuff.

Is it possible to set language on a per file basis in RubyMine?

I have found two questions, but they received answers saying to set a default: one for the file extension, and the other for the specific file name.
It feels implied by those answers that this was impossible at the time to specify language with ad hoc, file-by-file specificity.
Is it possible? If so, how do I do it?
I happened to accidentally do something like this and was trying to figure out how to undo it. RubyMine had somehow put a specific filename in the file name pattern list. This might be close enough to what this question was asking.

File names in programs: why the need for them?

I'm learning the basics of programming, and am currently going over calling files in pseodocode.
My text explains the process of calling a file to read or write to, but it doesn't explain why we have an internal name to reference a file to which we read or write. When I was reviewing with a friend, we thought perhaps it's because the program itself would need something like a variable to reference the actual file in memory.
Would anyone mind clarifying why we reference existing files in memory with a file name in a program? I would really appreciate the understanding.
Thank you so much for your time!
The reason why we name objects in programs is to separate their semantic meaning from their transient features.
In your case, a program may let the user place a file in a directory, other than the default one. In that case the filename would change accordingly, while the internal name used by the program to refer to the file object would remain.

Possible to copy/move/etc multiple files of same base name via Windows CMD/.BAT?

I am wondering if it is possible to accomplish the following, given some context and example.
I have files in "Server\Share\Folder\File##.ext"
Sometimes the "File##.ext" can be "File01.ext" through "File20.ext", and other times it may be "File01.ext" through "File40.ext"
Sometimes there are less of these files, sometimes there are more.
I want a batch file to take the files from "Server\Share\Folder\File##.ext" and move them to "Server\Share\OtherFolder\File##.ext". I know I can accomplish this easily with:
copy /y "Server\Share\Folder\File01.ext" "Server\Share\OtherFolder\File01.ext"
Then just add another line for each extra "File02.ext, File03.ext, etc., but I am wondering if it is possible to make it so that any file that resembles "File##.ext" can be included, so that no matter how many ## I have, it always works without issue.
Thanks in advance for any and all advice!
EDIT
Someone mentioned using Wildcards, but my question with that is - lets say those files are File01.ext through File05.ext, will it match what it finds to the newly moved file? Like will it find File01 from File?? on the source and Make it File01 from File?? at the destination?
You can accomplish this task with a FORloop program in batch-file.
You can also loop through the Commands using : and variable name.
Combining these two would help you get what you want.
We can help you with Ideas and little bit of the coding. But the Efforts must be done by you. So U can learn programming better

Operating system independent image addressing

Due to using both Windows and Ubuntu on my computer I'd like to be able to create documents independently. I have one directory for logos and I want to use them in any documents everywhere.
The problem with different file addressing I solved with those commands:
\newcommand{\winlogo}{D:/logo/}
\newcommand{\linlogo}{/media/DATA/logo/}
\includegraphics{\winlogo logo_bw}
How to provide this feature:
if(parameter==windows){adress:=D:/logo/}
elseif(parameter=linux){adress:=/media/DATA/logo}
else{error}
I've run into this problem as well, and I found that hard-coding the paths is an absolutely terrible idea. Also, keeping these directories in sync will eventually be a problem once your projects begin to grow.
The way I solved this was to put everything in version control (I like git, your mileage may vary).
Then I created an images folder, so my folder hierarchy looks like this:
Working-Dir
|-- images/
|-- myfile.tex
|-- nextfile.tex
Then in the preamble of my documents: \usepackage{graphicx} and \graphicspath{{images/}} which tells latex to look for a folder called images, then look for the graphics inside the folder.
Then I do my work on on comp, push my finished work back the repo, and when I switch computers I just pull from my repo. This way, everything stays in sync, no matter which computer i'm working on.
Treating tex source like source code has greatly improved my work flow and efficiency. I'd suggest similar measures for anyone dealing with a lot of latex source.
EDIT:
From: http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics
Graphics storage
There is a way to tell LaTeX where to
look for images: for example, it can
be useful if you store images
centrally for use in many different
documents. The answer is in the
command \graphicspath which you supply
with an argument giving the name of an
additional directory path you want
searched when a file uses the
\includegraphics command, here are
some examples:
\graphicspath{{c:\mypict~1\camera}}
\graphicspath{{/var/lib/images/}}
\graphicspath{{./images/}}
\graphicspath{{images_folder/}{other_folder/}{third_folder/}}
please see
http://www.ctan.org/tex-archive/macros/latex/required/graphics/grfguide.pdf
As you may have noticed, in the first
example I've used the "safe" (MS-DOS)
form of the Windows MyPictures folder
because it's a bad idea to use
directory names containing spaces.
Using absolute paths, \graphicspath
does make your file less portable,
while using relative paths (like the
last example), you shouldn't have any
problem with portability, but remember
not to use spaces in file-names.
Alternatively, if you are using
PDFLaTeX, you can use the package
grffile which will then allow you to
use spaces in file names.
The third option should do you well-- just specify multiple paths for the \graphicspath I wonder if LaTeX will fail gracefully if you just include all of your paths in there (one for images, one for your logs on linux, one for your logos on windows)?
Mica, thank you once more, your advice works properly!
I've tested this code in preamble, in .sty file it doesn't work:
\usepackage{graphicx}
\graphicspath{{/media/DATA/logo/}{d:/logo/}{img/}}
where
/media/DATA/logo/ is address to directory with logos on mounted partition in Linux
d:/logo/ is address to same directory in windows
img/ is address of images for current document in actual working directory
and this code in document:
\includegraphics{logo_zcu_c} from logo dir
\includegraphics{hvof} from img/ dir`

Resources