Why do I keep getting "The directory name is invalid"? - directory

I have been trying to get this to work for so long, yet it won't work. I am trying to navigate from Downloads to a certain folder so I can do something, however it just keeps saying "The directory name is invalid".
C:User/Damien/Downloads>cd JKLMBombpartyHelper-master.zip is what I am trying to do.
Does anyone know a certain reason of why this continues to occur?

JKLMBombpartyHelper-master.zip is not a directory, it's a zip, make sure to specify the relative/absolute directory you wanna cd into

Related

cannot find Meteor index.html

I have a simple query, a bit embarrassing as well. Dtube is an app that runs using meteor. I am looking to make some changes on the Dtube Home Page..changing icons and such. I have installed it on a linode. However, I am simply not able to locate the index file to make these changes to.
I tried
Locating all the files on linux named index.html in the dtube directory
Locating all the files containing the string div class name ...I was looking for in the dtube home page.
Still no luck.
Documentation is scarce and a bit confusing..
Can anyone simply point me to the path I should be looking at to modify the dtube homepage?
Someone who knows Dtube might be able to answer this.
All HTML's and CSS files are in https://github.com/dtube/dtube/tree/master/client
It's necessary rebuild the system to see the results.

Re-setting HOME directory in R

I'm having an issue running some packages (including rmarkdown) in R. The problem is because I'm using Windows 10 and my HOME directory path includes spaces:
C:/Users/My Name/Documents
From doing a bit of research I realise that I need to change my HOME directory to something that doesn't have spaces; this is explained in this post, but not specifically how one should go about doing it.
I have two questions about this problem:
How do I change the HOME directory to a path with no spaces?
Will this cause issues when running other scripts, and if so is there a particular location on my C: drive that would be best to relocate HOME to?
An answer to this post suggests I should use Sys.setenv(R_USER="/my/desired/path"): would this force R to use a different HOME path? And if so, would I need to run this before running every script?
Edit: someone suggested looking at this post, but this doesn't quite get me where I want to be because I want to change the directory; so, re-setting the environment variable (by adding the .Renviron file to HOME) surely wouldn't work?
Many thanks!

File Path and Root issues

So I have my the path to my website code as follows:
C:/folder1/folder2/folder3/my published website code from VS2012 - on my website I get an attachment and I want to save it to the following path C:/folder4
when I try the following code: file.SaveAs(Server.MapPath("../../folder4/") + filename); it says that I am going past the root. Can someone explain to me what is going on and if and how I can solve this issue?
Server.MapPath() is used to get the path in relation to the server root. Since your trying to save it outside the server virtual directory, you could probably just hardcode the file.
file.SaveAs(#"C:/folder4/" + filename);
It might not work depending on your IIS worker pool permissions.
file.SaveAs(Server.MapPath("folder4/") + filename);
Because I cannot see your folders structure I would reccomend setting a breakpoint after Server.MapPath() to see the full URI Path to determin your next steps since it says you are past root you may have one to many "../" before your string.
As per the documentation for HttpServerUtility.MapPath:
you cannot specify a path outside of the Web application
which is exactly what you are trying to do. If you interpret "the root" to be the root folder of your application, that is even what the error message is telling you.
Either
use an absolute path or
store your data beneath the application folder
use MapPath("~/") to get the current directory and build a relative path from that (in essence, you just move the "../.." outside the call to MapPath)
I would probably recommend going with 2. as it will give less headaches wrt. permissions and multiple sites hosted on the same server.
Server.MapPath(...) tries to return a physical ("real") directory for the virtual or relative path you give it. And since a virtual directory can't be located "over" the root in that sense, what you're trying to do makes no sense. You can go from domain.com/somefolder to domain.com/, but you can't really go any farther back.
You could instead use Environment.CurrentDirectoryas the starting point to find your folder, and apart from that just use SaveAs(..) as you're already doing.

DirCopy() Not Working

I'm working in AutoIT to script a basic task I'll have to repeat on 50ish workstations.
I need to copy a directory and it's subdirectories and files (recursively) to a network share as a backup. For some reason, DirCopy() does not work at all.
I've tried running it on several different directories (thinking permissions issue, I'm Domain Admin account), tried doing a RunAs (again thinking permissions), and also put the #RequireAdmin tag to force the program to run on an elevated account. Nothing has worked. I can't even get it to copy empty directories.
DirCopy(#DesktopDir & "\SAMPLE\TEST1", #DesktopDir & "\SAMPLE\TEST2", 0)
Please advise!
Just figured this one out.
Turns out DirCopy() is a pretty stupid function that cannot handle if the destination directory already exists (it wants to create it for you). So if you kill the destination directory, then run the above code line, all woks as expected. But then if you add a new file into the source directory (TEST1 in my example), then it breaks again and does nothing.
Go figure...
Now time to find a work-around using something like xcopy...

Is it possible to set a default location for R packages instead of giving the user a choice?

Good afternoon!
I'm a system administrator at a university, and I am responsible for setting up the images for a computer lab. R is part of the default image, and for the longest time we only had a single log-in for all lab users, allowing us to set the default directory once and then image it across multiple systems. This has changed, and we're now having all users log on with a personalized log-in. That brings me to a problem I'm having with R, and why I'm turning to you.
You see, as most of you may be aware, when R is run for the first time, a dialog box opens up that prompts for a location to save packages and the like. Hit 'OK' and it's the user file, but hit anything else and it's wherever you put it. The problem is, we've locked down the systems rather tightly, and access to anything more than the user's individual directory is not something we like to do.
The question I have is this - is there a way to force R, on first run, via hands-free script or just a setting somewhere, to default to the user's directory on the system for package storage? This would prevent me from having to give All Users access to read and write to the R directory, and would have fewer possibilities of screwing up since they wouldn't actually have a choice to change it. If I have to continue giving permissions in that folder, I can, but I'd rather not.
Thanks!
Edit your .Renviron file to set the default path:
# .Renviron file
R_LIBS = '~/.R/library'
I can't test this right now, but I believe you could add something like Sys.setenv(R_LIBS_USER=path.expand('~\R\library')) to the Rprofile.site file found in the R etc directory.
'...to default to the user's directory on the system for package storage...'
another way, especially if you wanted different setting for staff/students would be to to use group policy to set an environment variable for selected machines/users at login.
e.g. the equivalent of...
SETX "R_LIBS" "\\fileserver2/department_shared/public/r/packages"
you can easily check if this has worked by starting R and trying
Sys.getenv("R_LIBS")
also, this command can then show you what packages are installed:
rownames(installed.packages())

Resources