finder – Can smart folders use relative paths?

I'm a video editor. I have found that it is often useful to keep a smart folder at the root level of external drives which searches the drive for media added in the last day. It's a handy way to quickly locate something I probably just downloaded; font, video, photo, vector graphic, or whatever.

Today, inspired by this blog post, I decided to update the template folder structure that I use to organize video productions, and I thought the same type of intelligent folder search would be useful not only at the player level but also by project. based.

My current workflow looks like this: I have a template folder "YYYYMMDD_ProjectName", which contains a bunch of empty (but organized) subfolders for different stages of development, different applications, etc. Each time I start a new project, I duplicate and name the entire hierarchy on a portable player. Portable players already have a _Recently_Added.savedsearch in the root.

This saved search at the root level is useful if I pass the reader to another editor, and I only need to create a new one when I get a new reader.

But since I work with different publishers on different projects, and we all work remotely now (more dropbox, less UPS), it occurred to me that saved research should live at the root of the project model and become instantiated every time i start a new project.

I tried to take a look in the .savedsearch plist and edit the file path with vscode, but if I try to save the paths ; relative accesses in the plist, it seems that they develop before executing, so that the query points again to the model folder, not to the content of the instantiated project (I & # 39 ; hope that makes sense).

I am not very familiar with the syntax of Spotlight raw queries, but I have already used it to perform complex searches. TLDR: Is there a way to save a search that looks recursively in the sister directories? I would prefer to stick with .savedSearhes because I would like to be able to share with other video editors who use MacOS, without forcing them to use Terminal.

I must mention that I am on Catalina 10.15.4

javascript – create folders for each user with multer

// I have a form to download files, in this case I want to download an image, I understand that when configuring the destination path end, if there is not a such folder it is created automatically, in my case i want to create a folder for each user i plan to add your username as name

This is my middleware

// middlewares
   app.use(express.urlencoded({extended: true}));
   app.use(methodOverride('_method'));
   app.use(session({
     secret: 'asd68r7qew5fd13s21va68t79e7q495s6df1w6e87rs45d64rw6e845a168',
     resave: true,
     saveUninitialized: true
   }));
   app.use(passport.initialize());
   app.use(passport.session());
   app.use(flash());
   app.use(morgan('dev'));
   app.use(multer({path: path.join(__dirname, `../public/img/${id_del_usuario}`}))); //aqui esta la configuracion de multer

// I don't think of any idea to do it and it is the first time I use this module, if you can help me, I would appreciate it

bash – How to organize overlapping configuration files and folders in the home directory and beyond!

These tools await their .foorc file where to reside ~ so there is no easy way to "better" organize this (besides not using the -a of ls so you don't always see them :-)) unless you want to compile everything from a modified source (appropriately).

Some tools use an environment variable to read their configuration from a custom location. This is tool specific however, you should check the man page to see if this is an option.

Some people use git or similar tools for easily sharing configurations between systems (and also as a way to access older versions), see (among a ton of other sources) these links.

PS: This is a fairly broad answer to a broad question. If you want specific advice for a specific tool, please ask a new question with the relevant details

Performance: 10,000 files in one folder versus 10,000 files in multiple folders

On my web space, I have a single folder with 10,000 images.

Is there a difference in performance if I organize them into sub-folders?

So instead of a folder /images I will have 1,000 files /images/topic with 10 images in each folder.

Is it a good practice to divide the php code into folders?

For a project that has multiple php files, I would like to know if it is a good practice to divide them according to their function.

Is it a good practice to divide the php code into folders?

Problem when creating folders in SharePoint online using the REST API and C # using an access token approach

I was trying to test the creation of a folder under the root folder in online sharepoint using an access token and a REST API using HTTPWebRequest classes from console application. I don't want to use sharepoint assemblies because I can't use this in my final code. But still get a prohibited exception 403 when getting the answer …

Can anyone kindly suggest if a useful reference documentation for this problem .. code i am using ..

void CreateFolder (channel token, channel library, channel folder)
{
sharePointSite string = "https://xxx.sharepoint.com/sites/xxx";
HttpWebRequest request = (HttpWebRequest) WebRequest.Create (sharePointSite + "/ _api / lists / getByTitle (& # 39;" + library + "& # 39;)");
// HttpWebRequest request = (HttpWebRequest) WebRequest.Create (sharepointURL + "/ _api / lists / getByTitle (& # 39;" + library + "& # 39;) / rootfolder / folder / add (url = & # 39;" + folder + "& # 39;)");
request.Method = "POST";
request.Accept = "application / json; odata = verbose";
//request.Headers.Add(HttpRequestHeader.Authorization, "Bearer" + token);
myWebRequest.Headers.Add ("Authorization", "Carrier");
ASCIIEncoding encoding = new ASCIIEncoding ();
// byte byte1 = encoding.GetBytes (request);
request.ContentLength = 0;
Console.WriteLine (request);

                try
                {
                    if (request.GetResponse().ToString() != null)
                    {
                        using (WebResponse response = request.GetResponse())
                        {
                            Console.WriteLine(response);
                            Console.ReadKey();
                        }
                        // Do something if the resource has changed.

                    }
                }
                catch (WebException wex)
                {

                    HttpWebResponse httpResponse = wex.Response as HttpWebResponse;
                    if (httpResponse.StatusCode != (HttpStatusCode.NotModified))
                    {                            // resource was not modified.
                        Console.WriteLine("Error occured from line 195");
                    }
                    // Something else happened. Rethrow or log.
                    //throw;
                }
                catch (Exception ex)
                {    // Something else happened. Rethrow or log
                    Console.WriteLine("Error occured from line 203");                        
                }

Folders and files under Library / List mixed during sorting, even the New folder command is activated in Online share point

I have encountered a problem that in some of my site collections (team site (no Office 365 group)), the folders / files in my created library / document list are mixed like:
enter description of image here
enter description of image here

I tried to search and found the similar problem, but I can make sure that the "New Folder" command is available for my library / document list.
I tried to modify the view to define the first sort with the type of column (icon link to the document) but still helpless.

The system document library (Documents) does not have this problem, but the manually created library / list has this problem.

Any ideas will be helpful. Thank you so much. Are there parameters for the site collection / list / library that can have an impact on the sorting result?

Thank you
-Justin

classification – Heritage: folders and files and the Liskov substitution principle

Based on what I read about Liskov's substitution principle, I understand that a square and rectangle class cannot be part of the same inheritance tree.

I would like to apply these ideas to a folder and a file, as they usually exist on the disk. Is there any property of one or the other or both that would force one to conclude that they too should not be part of the same inheritance tree according to Liskov?

What properties could we consider?

  1. The data. The files are made up of bytes. However, folders can be considered to consist of the bytes of the files they contain.

  2. Access to both is defined by permissions

I guess the property where the inheritance breaks down would be a property regarding containment. A folder contains files. A file does not work.

permissions – Windows ACL deny moving folders at hierarchy level

My goal is to prevent users from accidentally moving or deleting folders at a specific hierarchy level of a Windows Server 2019 share.

Two user groups: Admin and User

|-RootShareDirecory      <= Directory that is Shared
  |- ProjectFolder1      <= Folder should only be moved / changed / deleted by an admin
     |- File1.doc        <= User has full access to the content it self.
     |- SubFolder2       <= User has full access to the content it self.
  |- ProjectFolder2      <= Folder should only be moved / changed / deleted by an admin
  ...

I have found several solutions online for this problem, for example:

  1. How to prevent users from deleting a folder, while granting them modification permissions on other files and folders?
  2. https://blogs.uw.edu/curreri/disable-click-and-drag-on-folders/
  3. https://dilrukj.wordpress.com/2013/01/01/prevent-users-deleting-moving-or-drag-and-drop-folders-in-a-file-share/

So I tried all of them, obviously without success.

Most solutions rely on creating an acl for ProjectFolderX who refuse the delete action at User.

Unfortunately, I can only get two different results:

  1. the ProjectFolderX is still mobile, but all the other actions in the RootShareDirecory is refused.
  2. the ProjectFolderX is not mobile, but also the direct content inside (for example. File1.doc is not writable.

Can anyone give me a hint, how to fix this?
Thank you

macos – shortcut for showing hidden files and folders in the open file dialog?

DISCLAIMER / WARNING

Hidden files are usually hidden for a reason. Use the script below only if you are reasonably sure you know what you are doing. In other words: if you break your system by randomly deleting hidden files, it is your fault.


Here is the script I use to toggle show / not show hidden files inside Searcher.

(The native OSX shortcut to switch hidden files in Open / Save dialogs has already been mentioned by Mateusz Szlosek above)

The difference between my script and others that I've seen so far:

Most scripts do nothing else after killing Finder. Usually this means that you have to go back to the folder where you were originally located, since the automatic relaunch of the Finder does not reliably open your last active folder.

Instead, the script below reopens and focuses on your last active folder, i.e. the folder you were in while using the toggle, but now showing (or not) hidden files.

I assigned it a shortcut (cmd + shift +.) And I find that working with hidden files in the Finder is much more convenient now.

We thank Tetsujin who posted a script on this site some time ago that I adapted to add the functionality "reopen the last file".

on run {input, parameters}
    tell application "Finder"
        set var1 to POSIX path of (target of window 1 as alias)
    end tell
    set newHiddenVisiblesState to "YES"
    set oldHiddenVisiblesState to do shell script "defaults read com.apple.finder AppleShowAllFiles"
    if oldHiddenVisiblesState is in {"1", "YES"} then
        set newHiddenVisiblesState to "NO"
    end if
    do shell script "defaults write com.apple.finder AppleShowAllFiles " & newHiddenVisiblesState
    ---- Sleep hack mentioned below. 0.5s minimum, 1-2s safer. Ugly, but (probably) unavoidable.
    do shell script "killall Finder; sleep 0.5s"
    tell application "Finder"
        ---- Close other windows if Finder managed to relaunch already
        if application "Finder" is running then
            close every window
        end if
        open (var1 as POSIX file)
        activate
    end tell
end run

To use the script: Open a new workflow in Automator, drag into "Run AppleScript", copy and paste the code above and save to your services folder (usually, ~ / Library / Services /, afaik).

Attaching a shortcut to run a script should be covered elsewhere on this site. I limited the scope of my shortcut to the Finder only.


Note on style:

I have to resort to a little ugly hack, using & # 39; sleep & # 39; after killing Finder, before manually opening the original folder.

If I don't force this delay, there is a chance that OSX has already relaunched the Finder and opened a folder (not necessarily the last active, in my experience). With my own "open" command, this can lead to the unpleasant effect of two Finder processes (even kills), and the Finder no longer works at all. If this happens, logging out and logging back in solves it, but it is obviously a waste of time, so I am using & # 39; sleep & # 39 ;.

A sleep value of 0.5s works for me, but to be sure, you can increase it slightly (which adds more visible delay to the process).

If someone knows of a way to suppress relaunch of Finder and unreliable opening of a window after sending the killall signal – or some other way to get rid of the “ sleep '' hack 39; & # 39; – I would be happy to hear it!