Coldfusion cfdirectory only lists some files in a directory when all the files are the same - coldfusion

I have a page that uses a <cfdirectory tag to display PDF files in a directory for a user to choose. The directory it is looking at contains folders each of which is named in mm-dd-yyyy format. The folders go from 07-28-2021 all the way back to 06-22-2015. Each folder contains a series of PDF files for that day.
The page with the cfdirectory tag displays all the files up to the 06-08-2020 folder. It will not display any of the subsequent files. Logically one would assume that since coldfusion will display some of the files that something must have changed with the files themselves after 06/08/2020 but I have compared the properties on the folders and files it will display with the ones that it will not and see no differences.
My cfdirectory tag looks like this:
<cfdirectory
directory="D:\Domains\zzzz\POM\zzzz\POM\"
name = "directoryFileList"
sort = "name DESC, size ASC">
So it will display all the files up to the ones in the D:\Domains\zzzz\POM\zzzz\POM\06-08-2020 folder. It will not display the files in the D:\Domains\zzzz\POM\zzzz\POM\06-09-2020 folder or any files dated after that.
We are using ColdFusion 2016. I am at a loss as to why it will list files only up to a certain date. Is this a problem with caching? Is there some hidden file attribute that I'm not seeing when I view the properties? I appreciate any help!

Related

How to check whether a folder exists or not in gcp cloud storage out of 1 million folders

For example I have structure like this.
bucketname/checked/folder1/some files
bucketname/checked/folder2/some files
bucketname/checked/folder3/some files
bucketname/checked/folder4/some files
bucketname/checked/folder5/some files
bucketname/checked/folder6/some files
bucketname/checked/folder7/some files
bucketname/checked/folder8/some files
bucketname/checked/folder9/some files
bucketname/checked/folder10/some files
bucketname/checked/folder11/some files
......
......
bucketname/checked/folder-1million/some files
Now,
1. If I have to check whether folder99999 exists or not. So,what would be the best way to check it (we have information of folder name - folder99999) ?
2. If we simply check path that exists or not, and if not then it means, folder don't exists. would it work fine If we have millions of folders?
3. Which data structure gcp uses to retrieve the folder data ?
The true answer is this one provided by John: folder doesn't exist. All the files are stored at the root directory (bucket level) and the file name is the full path. By human convention, the / is the folder separator and the console display fake folders.
If you haven't files in a "folder", the "folder" doesn't exist, it's not interpreted/deduced from the name fully qualified path. The folder is not a Cloud Storage resource
It's also for that reason that you search only by path prefix
However, it depends what you want to check. If you exactly know which folder you want to check and validate, and if there is at least one file in it, you can directly list the files with the folder path as prefix.

How does Django store it's staicfiles after collectstatic is run?

I need a bit of clarification regarding how Django updates its static files. Here is a hypothetical that will explain my predicament:
I'm working on my own website which requires a link to a PDF that is stored as a static file.
Later I replaced this PDF file, with a slightly altered name, and made corrections respectively in my code.
Then I run the collectstatic command to replace the old static files and everything works as expected. Explorer shows me that the old files have been properly replaced in their respective folders.
When I go to test the link I'm still forwarded to my old PDF file. The old staticfile as if nothing has been replaced.
Can anyone explain to me how this happened? I'm just concerned and a bit freaked out that my old static file is still being referenced. I mean it could just be a simple typo or I have a haunted static folder on my hands.
When collectstatic command is run Django searches for present static files in STATICFILES_DIRS and copies them into STATIC_ROOT path.
The link to file that Django returns - is exactly how it is set in code - Django will not search it this file is present to show the link.
Check or search your code for old file name, maybe it is left somewhere.
Also, static files usually are css, js, images - files used in rendering page. User content, data files (PDF file looks to be one of these) for downloading via download link - should be served as MEDIA FILES.

Filezilla lets to duplicate files with utf8 filenames in same folder

When I'm uploading all folder tree with all files, filezilla corrupts files with utf8 filenames. It writes them there, the files are OK, but they isn't served by nginx.
When I open some folder and select files from my computer same folder, draging them by hand, they duplicates, but these new files, are shown by nginx!
So if I originally uploaded 6 files to current folder when uploading all folders tree, then opening just this one current folder Filezilla lets me again to upload same 6 files, but it becomes as 12 files. When I select to drag files again, it won't become 18, Filezilla overwriting these 6 which I had draged by hand, leaves another 6 untouched.
I have about 2000 different folders in my folders tree, with files inside. When I upload all folder tree, no files which has utf8 in filename are shown by nginx. When I open every dir and redrag files by hand, they start work on nginx, also they are draged as new ones in that folder as I said before.
Resume:
Filezilla uploading files somehow wrong when uploading all folder tree... But Correctly when dragging only files.
I googled for you, and found this advice:
I am not sure if it solves your problem, but try under "File
server manager" "character set" and there force UTF-8.

having file names and delete them

I want to have access to all files of a folder and have a list of them and work with them.
For example: there is a folder named "new folder" and consist of files : 1.txt and 2.txt
I don't know what are in the folder new folder. So I want a list of files in it .
Hence the questions are :
1- How can I have such this list?
2- How can I delete a file (e.g 2.txt) whether i know there is file with this name or not.
3- Is it possible to figure out has a txt file been used or not (whether it is empty or not)
thanks;
I'd use Boost filesystem to analyze folder content, and remove to delete the file. You will find in filesystem tutorial some sample that will ease your work.
edit: remove(path) it's available in boost filesystem.

FileSyncProvider: DetectChanges not detecting certain files

I'm using the Microsoft Sync Framework to sync files using the FileSyncProvider. One thing I noticed is that the method DetectChanges of the FileSyncProvider is ignoring or not detecting certain files.
These files are not locked by any process, the user has full rights to these files, and they are not password protected. The problematic files consist of two PDFs and one Word document. However, there are other PDFs and Word documents in the batch that are in fact being detected. I have copied the files over to another PC and had no luck.
I'm baffled as to why these files are not being detected. Thoughts?
The problem ended up being that the problematic files had the T or Temporary attribute. I was excluding files that had the T attribute. To alleviate this, I added an exclude for files or folders that had the .tmp extension.
FileSyncScopeFilter fileSyncScopeFilter = new FileSyncScopeFilter();
fileSyncScopeFilter.AttributeExcludeMask = FileAttributes.System | FileAttributes.Hidden;
fileSyncScopeFilter.FileNameExcludes.Add("*.tmp");
fileSyncScopeFilter.FileNameExcludes.Add("*.lnk");
fileSyncScopeFilter.FileNameExcludes.Add("*.pst");